|
|
Re: Stacked BarChar - change one serie to Line [message #958386 is a reply to message #958180] |
Fri, 26 October 2012 00:38   |
|
Looks like you might be able to get this to happen, in the beforeGeneration script. With the stacked bar with optional grouping, I wasn't able to create my own lineSeries and put it in there, in some quick testing. I was able to create a hidden line series and steal one line from the hidden series definition and put it in the stacked bar visible series definition, however, it had to be a stacked series, which might not work for you.
Edit:
If you create a second identical series, in your chart only make it a line chart and unstack it. You can simply step through your series and hide the stacked bar and then step through the next series and hide all lines except the one you want to show, with a script like this:
function beforeGeneration( chart, icsc )
{
xAxis = chart.getAxes().get(0);
yAxis = xAxis.getAssociatedAxes().get(0);
sd1 = yAxis.getSeriesDefinitions().get(0);
sd2 = yAxis.getSeriesDefinitions().get(1);
for(i=0;i<sd1.getSeries().size();i++){
if(sd1.getSeries().get(i).getSeriesIdentifier() == "Series 1"){
sd1.getSeries().get(i).setVisible(true);
}
else if(sd1.getSeries().get(i).getSeriesIdentifier() == "total"){
sd1.getSeries().get(i).setVisible(false);
}
else{
sd1.getSeries().get(i).setVisible(true);
}
}
for(i=0;i<sd2.getSeries().size();i++){
if(sd2.getSeries().get(i).getSeriesIdentifier() == "Series 2"){
sd2.getSeries().get(i).setVisible(true);
}
else if(sd2.getSeries().get(i).getSeriesIdentifier() == "total"){
sd2.getSeries().get(i).setVisible(true);
}
else{
sd2.getSeries().get(i).setVisible(false);
}
}
}
Michael
Developer Evangelist, Silanis
[Updated on: Fri, 26 October 2012 01:28] Report message to a moderator
|
|
|
|
Re: Stacked BarChar - change one serie to Line [message #964539 is a reply to message #963189] |
Tue, 30 October 2012 15:57   |
|
I went a little bit further, in my script above and actually removed the unwanted series, rather than just hiding them. This should take care of your legend issues. Let me know your version and I can attach an example report.
Michael
Developer Evangelist, Silanis
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01969 seconds