0

の rangeAxis からズームアウトする必要があるため、この目的でzoomRangejFreeChartを使用しました。

しかし、私は何が何であるかを理解していませんでしたlowerPercentupperPercent

以下の画像のようにrangeAxisを設定したいと思います。どうやってやるの?

私はこれを試しましたが、値がどうあるべきかわかりませんrangeAxis.zoomRange(0,?)

public class Profilee  {



    double last=0;
    ChartFrame frame1;

    JFreeChart chart;
    ChartUtilities cu=new ChartUtilitiesImpl();

    public void generateProfile(double[] pointValue,double[] distance){
        ArrayList pv=new ArrayList();
        ArrayList dist=new ArrayList();

        pv.add(pointValue);
        dist.add(distance);

        XYSeries series = new XYSeries("");
        for(int i=0;i<pointValue.length-1;i++){

              series.add(last,pointValue[i]);
              last=distance[i];
         }



      XYDataset xyDataset = new XYSeriesCollection(series);
      chart= ChartFactory.createXYAreaChart("Profile View Of Contour", "Distance", "Contour Value", xyDataset, PlotOrientation.VERTICAL, true, true, false);

      ValueAxis rangeAxis = chart.getXYPlot().getRangeAxis();

      //rangeAxis.setLowerBound(-3);
      rangeAxis.zoomRange(0,?);     //What should be Value over here?
      frame1=new ChartFrame("XYLine Chart",chart);

      frame1.setVisible(true);
      frame1.setSize(1300,700);
    }


    public static void main(String ar[]){
        Profilee pro=new Profilee();
        double[] pv={3,2,3,0,5,-2,10};
        double[] dist={1,4,8,12,14,20,24};
        pro.generateProfile(pv, dist);



    }

    private static class ChartUtilitiesImpl extends ChartUtilities {

        public ChartUtilitiesImpl() {
        }
    }
}

ここに画像の説明を入力

4

1 に答える 1

2

デフォルトでValueAxisは、データセットに対応するように範囲が自動的に調整されます。いずれかの方法を使用して、上の画像に示すように、明示的な範囲を採用できsetRange()ます。

rangeAxis.setRange(-8, 12);
于 2012-04-21T21:28:04.677 に答える