Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Boxplot - based on stock chart - change location script
Marta_D
<p>Hi,</p><p> </p><p>I need to have boxplots in my Birt report, so I made it as a stockchart (my query already reteurns all required quartiles). Unfortunately, it is impossible to show a median in a simple stockchart. I tried to manage it by creating second data series which shows only the median. </p><p>And now the problem: how to replace "the candles" of the second data series. I want them to overlap the first series.
I suppose that I need some java.script. I tried with sth like that (see script below), but it completely doesn't work (and I cannot fix it because I don't know java at all).</p><p> </p><p>I enclosed printscreen of my graph.</p><p> </p><p>I will be very greatefull if someone could give me some advices how to change location of the second data series. </p><p> </p><p>Thanks!!!</p><p>Marta</p><p> </p><p> </p><div>function afterDataSetFilled( series, dataSet, icsc )</div><div>{</div><div> if( series.getSeriesIdentifier() == "Series2" ){</div><div> halfseries++;</div><div> }</div><div>}</div><div> </div><div>halfseries=0;</div><div>currseries=0;</div><div>function beforeDrawSeries( series, isr, icsc )</div><div>{</div><div> if( isr.getSeriesRenderingHints() != null ){</div><div> var dpharray = isr.getSeriesRenderingHints().getDataPoints();</div><div> for( j=0;j<dpharray.length;j++){</div><div> var xval = dpharray[j].getLocation().getX();</div><div> if( currseries <= halfseries){</div><div> dpharray[j].getLocation().setX(xval-20);</div><div> }</div><div> </div><div> }</div><div> }</div><div> currseries++;</div><div>}</div><div> </div><div> </div>
Find more posts tagged with
Comments
kclark
<p>Sorry for the late reply, are you still having this issue? You said you tried to create a second data series? Do you mean a second y axis? At first glace, it would appear that creating a secondary y-axis to your report should solve your issue.</p>
Marta_D
<p>Hi Clark,</p><p> </p><p>thanks for your reply!
Unfortunately I think that second axis will not solve my problem. The issue is that I need to prepare a boxplot graph (and I have tried to manage it using stock charts - but the main problem with stock charts is that I cannot show median value ("this line in the middle of bars"). So I came up with idea to solve this problem with second data series (only with median values) which has to somehow overlap the basic stock chart. Everything is fine, but... with second data series my "median values series" is beside bars (is not overlaping) -> I think it will be easier if you could take a look at a picture enclosed in my previous post. </p><p>To sum up: I just need to move second data series backwards ( o have beautiful box plots). I belive that it's possible with some small java script. But I have no idea how to solve it.</p><p> </p><p>Thanks in advance for your help!</p><p> </p><p> </p><p>Cheers,</p><p>Marta</p>