Time for action — adding a trendline to show target revenue
1. Create a copy of
ChartBackground.html
andChartBackground.xml
, and rename them toTrendline.html
andTrendline.xml
respectively.2. Add the following code to
Trendline.xml
right after the chart data:<trendLines> <line startValue='430000' color='009933' displayvalue='Target' /> </trendLines>
3. Open
Trendline.html
in a browser.
What just happened?
Your chart can have multiple trendlines on a chart, so they need to be enclosed within the<trendlines></trendlines>
tags. For each trendline, you need a<line>
element. We then defined its start value, color and the label to be displayed alongside the trendline. In case your trendline needs to have a different end value, you can define that as well using the endValue
attribute that would result in a slanted trendline.
Have a go hero — add a trendzone to the chart
Trendzones are similar to trendlines, except that they mark out a range, and hence, necessarily...