Loading JSON data to Highcharts data from JSON Response

Loading JSON data to Highcharts data from JSON Response

Highcharts is a one type of used to charting library written in pure js – JavaScript used, offering an basic easy simple way of adding all design and structure interactive charts and user friendly charts to your web site or mobile responsive or web application for Loading JSON data to Highcharts data from JSON Response.

The Highcharts currently supports Like as a line charts, spline charts, area charts, areaspline charts, column charts, bar charts, pie charts and scatter charts types

1. Set up the chart options – Syntax

This is a simple shortcut Ajax call example for JSON to get our data:

$.getJSON("data.json", function(json) {
...
console.log(json);
....
.....
});

2.Data.json

[{"key":"AngularJs","value":98},
 {"key":"VueJs","value":78},
 {"key":"PHP","value":70},
 {"key":"Laravel","value":90},
 {"key":"Magento","value":79
}]

Include jQuery Libs

		
	

Script.js


        $(function () {
                var fetchdata_json = new Array();   
                $.getJSON('data.json', function(data) {
                    // Populate simple Languages
                    for (i = 0; i < data.length; i++){
                        fetchdata_json.push([data[i].key, data[i].value]);
                    }
                 
                    // here simple bar draw chart
                    $('#container').highcharts({
                    chart: {
                        type: "column"//type defination
                    },
                    title: {
                        text: "Programming data"
                    },
                    xAxis: {
                        type: 'category',
                        allowDecimals: false,
                        title: {
                            text: ""
                        }
                    },
                    yAxis: {
                        title: {
                            text: "Marks"
                        }
                    },
                    series: [{
	                    name: 'Subjects',
                        data: fetchdata_json
                    }]
                }); 
            });
        });
    

3.index.html

Highcharts all data simple load from a JSON data using custom JSON Processing

View Demo

We hope you get an idea about Loading JSON data to Highcharts data from JSON Response
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Leave a Comment