Here we ‘ll look at the visualization of data using highcharts. Generally, data visualization presents the data in a 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 the 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 from each company separately,
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 the series array in highcharts.
Now we pass some data like chart title, X-axis name, y-axis name to highcharts.
We pass this chartArray to welcome view.
In the view, we simply pass this array to highcharts.
The output of our visualization