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)
Changing a series label in a specific serie
crrocha
<p>Hello,</p>
<p> </p>
<p>I'm having trouble changing the series label of a specific chart serie.</p>
<p> </p>
<p>I have 2 series in my chart (Series 1 - Bar Series and Series 2 - Line Series) and I want to change only the label of the Series 2.</p>
<pre class="_prettyXprint _lang-js">
function beforeDrawDataPointLabel( dph, label, icsc )
{
// change the label of ALL series
label.getCaption().setValue("# " + dph.getDisplayValue());
}
</pre>
<p>There is a way to apply this code in one of the series?</p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Thanks in advance.</span></p>
Find more posts tagged with
Comments
JFreeman
<p>You can get the series name and then only apply the label changes to the desired series.</p>
<p>For Example:</p>
<pre class="_prettyXprint _lang-js">
function beforeDrawDataPointLabel( dph, label, icsc )
{
var seriesName = dph.getSeriesValue();
if(seriesName == "Series 2"){
label.getCaption().setValue("# " + dph.getDisplayValue());
}
}
</pre>