Results 1 to 1 of 1
Thread: jFreeChart autoscale
- 11-05-2009, 07:58 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 48
- Rep Power
- 0
jFreeChart autoscale
Hello everyone..I've created a simple chart using the comp in the title..But the scale is not convient for imaging the chart... For example, i plot chart that contain values from 140000-150000 but the chart display all value from 0 to 150000.
How i can set AUTOSCALE inthe features of the Jfreechart ?
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(s1);
JFreeChart chart = ChartFactory.createXYLineChart("Your chart", "X", "Y", dataset,PlotOrientation.VERTICAL, false, false, false);
chart.setBackgroundPaint(Color.white);
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
final NumberAxis xAxis = (NumberAxis)plot.getDomainAxis();
xAxis.setStandardTickUnits(NumberAxis.createIntege rTickUnits());
xAxis.setAutoRange(true);
final NumberAxis yAxis = new NumberAxis();
yAxis.setAutoRange(true);
plot.setDomainAxis(xAxis);
plot.setRangeAxis(yAxis);
final ChartPanel chartPanel = new ChartPanel(chart);
jfrm.add(chartPanel);Last edited by cowboy; 11-05-2009 at 08:33 AM.
Similar Threads
-
Jfreechart help
By shruti in forum AWT / SwingReplies: 1Last Post: 07-11-2009, 04:16 AM -
JfreeChart
By puk284 in forum Advanced JavaReplies: 1Last Post: 05-12-2009, 04:52 PM -
JFreeChart 1.0.11
By Java Tip in forum Java SoftwareReplies: 0Last Post: 09-26-2008, 07:52 PM -
JFreeChart 1.0.7
By JavaBean in forum Java SoftwareReplies: 0Last Post: 11-17-2007, 02:13 PM -
JFreeChart 1.0.5
By levent in forum Java SoftwareReplies: 0Last Post: 05-10-2007, 05:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks