Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

2. Customizing your Chart > Time for action — adding a trendline to show target...

Time for action — adding a trendline to show target revenue

  1. Create a copy of ChartBackground.html and ChartBackground.xml, and rename them to Trendline.html and Trendline.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.
    Time for action — adding a trendline to show target revenue

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial