Hi iam trying to append the dynamic data to highchart in series.And iam using column chart my code in jquery is some thing like this
- "container" style="min-width: 310px; height: 400px; margin: 0 auto">
- function GetEmpDetails() {
- $.ajax({
- type: "POST",
- url: "../Home/GetData",
- data: JSON.stringify({ abc: abc }),
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (result) {
- console.log(result);
- for (x in result) {
- var dataobject = new Object();
- dataobject.salary = result[x].SALARY;
- dataobject.name = result[x].NAME;
- obj.push(dataobject);
- }
- visitorData(obj);
- }
- });
- }
- function visitorData(obj) {
- Highcharts.chart('container', {
- chart: {
- type: 'column'
- },
- title: {
- text: 'Salary per Month'
- },
- subtitle: {
- text: ''
- },
- xAxis: {
- type: 'category',
- categories: obj.NAME
- },
- yAxis: {
- title: {
- text: 'Total Work Done'
- }
- },
- legend: {
- enabled: false
- },
- plotOptions: {
- series: {
- borderWidth: 0,
- dataLabels: {
- enabled: true,
- format: '{point.y:.1f}%'
- }
- }
- },
- tooltip: {
- headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.y:.2f}% of total
' - },
- "series": [
- {
- "name": "Browsers",
- "colorByPoint": true,
- "data": [
- {
- "name": obj.names,
- "y": obj.salaries,
- }
- ]
- }
- ]
- })
- }
Please help me...Thank you in advance

Sanoj VishwakarmaPosted May 11, 2018, 1:59 AM