Removing points from a chart

Article ID: 2259
Last updated: 29 May, 2018
Article ID: 2259
Last updated: 29 May, 2018
Revision: 3
Views: 729
Posted: 23 Jun, 2010
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to remove points from a chart?

Answer

Just call the method IlvDefaultDataSet.setData(double[] xValues, double[] yValues, int count) passing the double [] that does not contain the unwanted points.

Here is a code snippet that shows the typical routine:

public void removeOnePoint(int pointIndex)

{

int count= this.getSeries(0).getDataCount();

if (count>0) {

//REMOVE POINT

double XAxis[] = new double[count - 1];

double YAxis[] = new double[count - 1];

for (int i=0; i

XAxis[i] = this.getSeries(0).getXData(i);

YAxis[i] = this.getSeries(0).getYData(i);

}

for (int i=pointIndex+1; i

XAxis[i-1] = this.getSeries(0).getXData(i);

YAxis[i-1] = this.getSeries(0).getYData(i);

}

//UPDATE THE DATA

this.getSeries(0).setData(XAxis, YAxis, count - 1);

}

}


Note: In order to run this sample in JViews 8.7 and later, you must call the ilog.views.util.IlvProductUtil.DeploymentLicenceRequired method with the appropriate argument.


This article was:   Helpful | Not helpful
Report an issue
Article ID: 2259
Last updated: 29 May, 2018
Revision: 3
Views: 729
Posted: 23 Jun, 2010 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Attached files

Also listed in


Others in this category