parameter combineddomainxyplot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
maexchen
Posts: 15
Joined: Tue Nov 21, 2006 10:16 am

parameter combineddomainxyplot

Post by maexchen » Mon Feb 19, 2007 12:21 pm

Hello!
I have:

Code: Select all

  public ecgcombined() throws IOException {
        SUBPLOT_COUNT = ncol;
        final CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
        datasets = new XYSeriesCollection[SUBPLOT_COUNT];
        
        XYSeries channel1 = new XYSeries("Channel 0");
        datasets[0] = new XYSeriesCollection (channel1);
        
        XYSeries channel2 = new XYSeries("Channel 1");
        datasets[1] = new XYSeriesCollection (channel2);
        
        int m=0;

       for (float j=0; j<a; j+=c){
           //System.out.println ("M: " +m);
           String strRepresentation = signal1.get(m).toString();
           Double.parseDouble(strRepresentation);
           double sample3 = Double.parseDouble(strRepresentation);
           channel1.add(j, sample3);
           
           m=m+1;
       }

       int n=0;

       for (float j=0; j<a; j+=c){
           
            String strRepresentation = signal2.get(n).toString();
            Double.parseDouble(strRepresentation);
            double sample4 = Double.parseDouble(strRepresentation);
            channel2.add(j, sample4);
            n=n+1;
        }
      
        for (int i = 0; i < SUBPLOT_COUNT; i++) {
  
            NumberAxis rangeAxis = new NumberAxis("Channel " + i + " [mV]");
            rangeAxis.setLowerBound(yMinMax[0]);
            rangeAxis.setUpperBound(yMinMax[1]);
            
            final XYPlot subplot = new XYPlot(
                    this.datasets[i], null, rangeAxis, new StandardXYItemRenderer()
            );
            subplot.setBackgroundPaint(Color.lightGray);
            subplot.setDomainGridlinePaint(Color.white);
            subplot.setRangeGridlinePaint(Color.white);

            
And now I want to use the parameter "subplot" in:

Code: Select all

   ItemListener listener = new ItemListener(){
        public void itemStateChanged(ItemEvent e) {
            
But how does it works??

Locked