Home
Designing Analytics Reports
Show only the last DataPointLabel on a lines chart
Migrateduser
<p>Hi!</p>
<p> </p>
<p>I'm trying to get a line chart with multiple series where only the last point (the rightmost one) is shown. So far I have had partial success with a script:</p>
<pre class="_prettyXprint _lang-js">
dpSize = 0
cnt = 0;
function afterDataSetFilled( series, dataSet, icsc )
{
dpSize = dataSet.getValues().length;
}
function beforeDrawDataPointLabel( dph, label, icsc )
{
if (cnt % 46 != 45) {
label.getCaption().setValue("");
}
cnt++;
}
</pre>
<p>(46 because my series have 46 points, I've to figure out how to get the length of the series).</p>
<p> </p>
<p>But, the problem is that some of my series have "0" as value, and looks like those are not counted as valid data points, so the math doesn't work. The below picture shows the data points and the value of "cnt" for each of them:</p>
<p> </p>
<p>
Find more posts tagged with
Comments
There are no comments yet