Hi:
We have some datasets with 0 as the value for volume. When we draw volume series for these values, we are getting horizontal axis drawn in the middle of the custom axis. But, what we would like to have is nothing drawn if all the values are ZERO. Is this possible? Any inputs are appreciated. Thank you.
best regards,
vasu[/img]
Volume Series with all zero values
Hi,
(There are several ways).
You can set the visibility of the series to false, if all values are 0. There are several methods which can give you an idea if the series contains only 0 values, among the getMaxYValue() and getMinYValue().
Depending on your code on how you fill the series, you can use an event to call the above code. As example (but far from optimal and recommended not to be used) the following will check the volumeSeries each time just before the chart will be painted:
Regards,
tom
(There are several ways).
You can set the visibility of the series to false, if all values are 0. There are several methods which can give you an idea if the series contains only 0 values, among the getMaxYValue() and getMinYValue().
Code: Select all
if (volumeSeries.getMaxYValue()==0 && volumeSeries.getMinYValue()==0) {
volumeSeries.setVisible(false);
}
Code: Select all
myChart.addChartPaintListener( new ChartPaintAdapter() {
public void chartPainting(ChartDrawEvent e) {
if (volumeSeries.getMaxYValue()==0 && volumeSeries.getMinYValue()==0) {
volumeSeries.setVisible(false);
};
};
};
tom