I am using jfreechart for plotting graphs. The problem is that if have more entries on the X-axis, then the X-axis parameters are not visible. How should I solve that?
Change the scale of the graph until you can see the parameters.
Related
I am using Jsy3d to draw a 3d scatter plot in Java. However, I noticed that the drawing order of the points seems to be based on the order of the given List of Points, not on the distance to the camera. Is there a way to fix this?
You are right, rendering is based on point declaration. Why would you change this?
To change the scatter rendering, simply override Scatter.draw(...)
You may use Camera.getDistance(coord) to get the distance to Camera. This method is already used by BarycenterOrderingStrategy in Graph to order the drawables (but this won't work for your scatter as it is a primitive Drawable).
Basically I am attempting to use JFreeChart right now to graph some values. The only problem is that the values are incredibly minuscule, e.g 7.069781E-13. I believe these values are too small for JFreeChart to display. How can I display these small values visually in Java in a line chart format?
It looks like this currently:
And I want to make it look similar to this:
I found a work around.
I simply multiplied all the values by a factor of 100 so the graph now looks similar to the one in the example. I will include a disclaimer in the legend saying the chart has been multiplied by a factor to clearly see the line chart.
Also consider these alternative:
Invoke setRange(), seen here, to expand the y axis in the area of interest.
Add suitable controls, seen here, to control y zoom.
Advise users how to use the mouse for zoom control, as shown here.
Is it possible to generate a bar graph in jFreeChart where bars all start around a particular value instead of the zero axis? Our team has interest in this view.
Here is an example where the default behavior has the bars all between the value and the origin. We want the bars to be between the value and the mean (average).
I suppose a workaround is we calculate the offset from the mean and plot them in respect to the origin and then hide the axis but then we are not able to show the axis to our users.
Instead of having bar graphs stop at another value besides the origin we are just redefining the graph axis origin to be at the mean and offsetting everything. So instead of something like exposure level we now call the value axis distance from aggregate mean. Not exactly what I was originally looking in the OP but a cleaner solution overall. We'll let the user toggle between the two modes.
I'm using JFreeChart, I want to scale this graph according to scale given beside, How can i scale this graph? Is there any Solution to this problem?
While Googling, I found writeScaledChartAsPNG, can i use this, how?
I need to scale the rangeAxis
It looks like writeScaledChartAsPNG() simply resamples the existing chart. Instead, use a zoom-related method of ChartPanel, such as zoomInRange(), and save the chart using writeChartAsPNG(). You might also experiment with zoomRange() on your rangeAxis.
I'm using a combined plot composed of 2 graph which share the same X axis (by sharing, I mean, the timeframe is the same for the two graph). The upper graph is a regular timeseries while the lower chart is a barchart. I would like to display a crosshair on the combined chart as a whole... Right now I can display crosshair only on each graph separately even thought I have specify on the combined plot that I wanted to display the crosshair. To be more explicit, I can't synchronise both crosshair... Any idea on how to achieve that ?
thanks
It would appear to work if you use a shared domain axis, as discussed here and as shown in CrosshairDemo2? In addition, an sscce might help clarify your usage.