Home
Designing Analytics Reports
Delete Y-Axis series at runtime from chart
crowt999
All,
I have a bar chart set up with 4 series on the Y-axis. In some instances, I will only have data to fill up 3 of the series, and in that case, I would like to delete the 4th series from the chart. I have the following code that will set any series I need to visible(false), but that still leaves the empty space where the bars used to be. I would like to be able to delete it entirely at run-time so that the space is reclaimed and the chart looks nice.
Here is my function that I can hide a series with: right now it sets the first and second series to invisible.
Is it possible to delete the runtimeseries ?
function beforeGeneration( chart, icsc )
{
var xAxis = chart.getAxes().get(0);
var yAxis = xAxis.getAssociatedAxes().get(0);
var ySeriesDef1 = yAxis.getSeriesDefinitions().get(0);
var ySeries1 = ySeriesDef1.getRunTimeSeries();
var RunSeries1 = ySeries1.get(0);
RunSeries1.setVisible(false);
var ySeriesDef2 = yAxis.getSeriesDefinitions().get(1);
var ySeries2 = ySeriesDef2.getRunTimeSeries();
var RunSeries2 = ySeries2.get(0);
RunSeries2.setVisible(false);
}
Thanks in advance for any help !
Dean
Find more posts tagged with
Comments
There are no comments yet