Book Image

Learning Highcharts 4

By : Joe Kuan
Book Image

Learning Highcharts 4

By: Joe Kuan

Overview of this book

Table of Contents (23 chapters)
Learning Highcharts 4
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Framing the chart with axes


In this section, we are going to look into the configuration of axes in Highcharts in terms of their functional area. We will start off with a plain line graph and gradually apply more options to the chart to demonstrate the effects.

Accessing the axis data type

There are two ways to specify data for a chart: categories and series data. For displaying intervals with specific names, we should use the categories field that expects an array of strings. Each entry in the categories array is then associated with the series data array. Alternatively, the axis interval values are embedded inside the series data array. Then, Highcharts extracts the series data for both axes, interprets the data type, and formats and labels the values appropriately.

The following is a straightforward example showing the use of categories:

    chart: {
        renderTo: 'container',
        height: 250,
        spacingRight: 20 
    },
    title: {
        text: 'Market Data: Nasdaq 100'
 ...