Here we ‘ll look at visualization of data using highcharts. Generally data visualization presents the data in graphical or pictorial format so it helps the readers to easily understand the data.
Highcharts.com provides with a lot of different types of charts – line, area, bar, column, pie and many more. Here we ‘ll implement line chart with required data fetched from database.
In this example we show yearly sales of 10 different companies, the database table can be found here.
The model file will look like,
We get data of each company seperately,
We get all the company names,
Now we push all the company names to an array so as to pass this array to highcharts
Now we push each of the company sales details into array,
Now we push each of this array into an array so as to pass this data to highcharts,
Passing name and data for series array in highcharts.
Now we pass some data like chart title, x-axis name, y-axis name to highcharts.