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)
Draw No of series in chart based on user selections using scripted dataset
Srinivas Yarra
Find more posts tagged with
Comments
Srinivas Yarra
<p>Hi ,</p>
<p> </p>
<p>User will choose the series from input params then same of series should display in the chart using scripted dataset</p>
<p> </p>
<p>Thanks,</p>
<p>Srinivas</p>
JFreeman
<p>I'm not really sure what your actual question is here.</p>
<p>Can you please provide more details on what you are asking?</p>
Srinivas Yarra
<p>Hi Jesse,</p>
<p> </p>
<p>Thank you for your reply.</p>
<p> </p>
<p>My use case :- We want to add output columns dynamically without define in data set level by manually while creating chart. </p>
<p> </p>
<p>We will give options to user to select as list box i.e. Series1, Series 2, Series 3.... etc. . Based on user selections at input params. We have to add output columns/computed columns dynamically using scripted data set and populated data as like in fetch function or some other function :</p>
<p> </p>
<p>if ( i < 3 )</p>
<div>{</div>
<div> row["category"] = sourcedata
[0];</div>
<div> //suppose user selected "series1,series2 and series 3" at input params </div>
<div> // series means measure</div>
<div> row["series1"] = sourcedata
[1];</div>
<div> row["series2"]= sourcedata
[2];</div>
<div> row["series3"]= sourcedata
[3];</div>
<div> i++;</div>
<div>return true;</div>
<div>}</div>
<div>return false;</div>
<div> </div>
<div>My rest service gives data to report. But, we have to display chart based on whatever measures client want instead of all available measures.</div>
<div> </div>
<div>Please find sample chart measures and out put columns in attachments</div>
<div> </div>
<div>Thanks,</div>
<div>Srinivas</div>
JFreeman
<p>What version of BIRT are you using?</p>
<p>What type of chart of chart are you using (SVG, PNG, etc.)?</p>
<p> </p>
<p>You are going to need to use the chart scripting to dynamically add series to the chart based on the parameters selected.</p>
<p>Let me know your version and type of chart and I will see about getting you a sample.</p>
Srinivas Yarra
<p>Hi Jesse,</p>
<p> </p>
<p>Thank you for your reply.</p>
<p> </p>
<p>We are using BIRT Designer Professional 4.4.0 in development environment and deploying in the iHub3.1 server. We did not give any specific chart type while design the chart using designer professional.</p>
<p> </p>
<p> We would like to do using scripted dataset because we are getting data from rest service call. We were able to displayed data in table dynamically. But, chart measures should be displayed based on the user selections from input params.</p>
<p> </p>
<p>Kindly provide any samples which draw the chart measures dynamically based on user selections.</p>
<p> </p>
<p>Thanks,</p>
<p>Srinivas</p>
JFreeman
<p>Thank you for the details on your version information.</p>
<p> </p>
<p>On the first page of the chart builder there is an "Output Format" drop down. In pro, this will typically be HTML5 default. However, your screenshot looked more like an SVG chart than an HTML5 chart.</p>
<p> </p>
<p>Can you please confirm which version of chart you are using?</p>
<p>There will be code differences between HTML5 and SVG.</p>
Srinivas Yarra
<p>Sorry Jesse, we are using Html5 charts.</p>
Srinivas Yarra
<p>Hi Jesse,</p>
<p> </p>
<p>Can you provide any sample code for generating html5 charts using scripted dataset.</p>
<p> </p>
<p>Thanks in Adv.</p>
<p>Srinivas</p>
JFreeman
<p>Take a look at this blog post on dynamically adding series to a chart: <a data-ipb='nomediaparse' href='
http://birtworld.blogspot.com/2008/10/dynamically-adding-series-to-birt-chart.html'>http://birtworld.blogspot.com/2008/10/dynamically-adding-series-to-birt-chart.html</a></p>
;
<p> </p>
<p>I tested this out in 4.4.0 Pro with an HTML5 chart and the sample code from that post works properly and looks to be exactly what you are needing.</p>