Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
always show LAST label
m_hess
Hi,
to prevent my charts from being flooded with labels, I'm using a little JavaScript Snippet I picked up in here somewhere. It basically does a modulo in beforeDrawDataPointLabel() to decide wether the current label should be made visible.
Although this works good so far, I have a minor issue with this approach. Depeding on the number of datapoints in the series, the last rendered label is not guaranteed to appear above the last datapoint. Since I'm doing some charting over time, I have the need for this last label to appear, since it represents the "current" value.
Does anyone know, how to get this done?
Find more posts tagged with
Comments
mwilliams
Hi M_hess,
One way to achieve that would be to make a computed column in your dataSet, which you can hide in your table, to show a count of the number of rows in the result set. Or just an aggregation in the footer of your table that counts the number of rows. You can then script in your table to make this value a PersistentGlobalVariable to use in your chart script.
In your script for the chart, you can keep a running count for each label displayed and/or blocked on your axis. Then in a simple statement, you can check to see if the PersistentGlobalVariable value equals the label count. When it does, you output the correct value for the label. This should catch the last one every time.
Hope this helps.