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
  • PrintPrint
Share this Page URL
Help

2. Customizing your Chart > Time for action — customizing the chart limits and ...

Time for action — customizing the chart limits and the number of divisional lines

Time for action — customizing the chart limits and the number of divisional lines Create a copy of ChartBackground.html and ChartBackground.xml, and rename them to ChartLimitCustomization.html and ChartLimitCustomization.xml respectively. Make the change in XML data URL and remove the background attribute for all the forthcoming examples, wherever we make a copy of the chart background files, let's assume this step by default to keep our focus on the new stuff.Add the attributes adjustDiv='0' yAxisMaxvalue='3000000' numDivLines='2' to the<chart> element.Check out ChartLimitCustomization.html in a browser to see how the chart limits and the divisional lines are under your control now. What just happened? First up, as we wanted to explicitly specify the y-axis upper limit and the number of divisional lines, we had to disable automatic adjustment of divisional lines using adjustDiv='0'. It is pretty simple after that, we just set the y-axis upper limit using yAxisMaxValue='3000000', and the number of divisional lines to 2 using numDivLines='2'. That's it, we are done. Similar to the upper limit, you can also set the lower limit for the chart explicitly using the yAxisMinValue attribute. However, changing the lower limit to anything other than zero makes the differences in values appear much more than they actually are, and we don't recommend using it. Tip Does the y-axis look too cluttered? Skip some values. In case you need a large number of divisional lines each with their corresponding values on the chart, the y-axis can get cluttered. As reducing the number of divisional lines is not an option, you can opt to skip every nth value on the y-axis using the yAxisValuesStep attribute. So if you set yAxisValuesStep='2', every second value on the y-axis will be shown, skipping one in between.

  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint