Results 1 to 1 of 1
  1. #1
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default 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

  1. JFreeChart 1.0.11
    By Java Tip in forum Java Software
    Replies: 3
    Last Post: 04-18-2014, 08:27 PM
  2. Jfreechart help
    By shruti in forum AWT / Swing
    Replies: 1
    Last Post: 07-11-2009, 04:16 AM
  3. JfreeChart
    By puk284 in forum Advanced Java
    Replies: 1
    Last Post: 05-12-2009, 04:52 PM
  4. JFreeChart 1.0.7
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-17-2007, 02:13 PM
  5. JFreeChart 1.0.5
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-10-2007, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •