Continuing with the series on how to get the most out of the new features of FusionCharts v3.1, here’s our latest – custom string labels (annotations) for individual data sets. In case you tuned into the series just now, here’s what we have already covered:
Back to the topic at hand – custom string labels. Let’s call them annotations for the sake of brevity. Annotations make a chart more information-intensive, thus enhancing decision-making. Let’s look at an example before we dive into the details:
See how neatly we have appended the labels “Birthday Discount – 30%” and “New Website” to explain the increase in sales for March and May respectively. And the XML going behind this is no rocket science either:
<chart caption="Monthly Sales for Jan-Jun 2008" useroundedges="1" numberprefix="$" bgcolor="”FFFFFF”" decimals="0"> </chart>
All of what you need to do is just over-write the default display value with your own text, using the displayValue attribute. And because we over-wrote the default display value for the data sets, we had to put in the figures $60K and $58K manually.
Without annotations, you would have a chart with only the sales figures plotted in it and every time you wanted to know why a particular month showed an increase or decrease in sales, you would have probably referred an Excel file which had all these details. But with annotations, all of the information that you need for your decision-making comes neatly packed as a whole – so not only can you make decisions backed with concrete numbers, you can make them much faster now.
While the example shown above is a very clichéd one, there are a multitude of other places that you can use it too – website stats with annotations like “Increased Page Rank” or “System Maintenance”, company expenditures with annotations like “Pizza Day” or “The Big Party” or even in your personal weight chart with “The 10K Run” or “The Free Booze Night.”