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)
Dynamic chart title using data set
tcm.matos
Hello, i'm trying to get data from an data set to make an dynamic title in a chart.<br />
<br />
Today my dynamic chart title is done this way:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeGeneration( chart, icsc ) {
var title = "Problema - " +
icsc.getExternalContext().getScriptable().getParameterValue("nmAgrupOrigProb") + " por Per?odo";
chart.getTitle().getLabel().getCaption().setValue(decodeURI(title));
}
</pre>
<br />
There is something like this in birt?<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var cdProblemRow = icsc.getExternalContext().getDataSet("myDataSet").getRow("CDPROBLEM");
chart.getTitle().getLabel().getCaption().setValue(decodeURI(cdProblemRow));
</pre>
Thanks.
Find more posts tagged with
Comments
kclark
What logic are you using to decide what data to use for the title? You can set the value you want to use in a PGV in the fetch() of your dataset. Later in the beforeGeneration() of the chart you can recall that value and set it as the chart title.