score:1
I eventually made it work with the following solution:
In the analysisajax.php
script, I no longer generate the yaxis
. I only send name
and data
.
The code to generate the graph now looks like this:
var updateChart = function(json) {
//console.log(json)
var options = {
chart: {
renderTo: 'graph',
type: 'line',
zoomType: 'x'
},
title: { text: null },
yAxis:[],
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'bottom'
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 0
}
},
series: [],
tooltip: { shared: true }
}
var chart = new Highcharts.Chart(options);
// update axis and series
for (i=0; i<json.length; i++) {
// add axis
chart.addAxis({ title: { text: json[i].name } });
// add serie
var a = chart.series.length;
var seriesOptions = {
name: json[i].name,
data: json[i].data,
yAxis: a
}
chart.addSeries(seriesOptions,true);
chart.options.series.push(seriesOptions);
}
}
$(document).ready(function() {
$('#f').change(function() {
var requestParams = { f: $('#f').val() };
$.post('analysisajax.php', requestParams, updateChart);
//return false;
});
});
Source: stackoverflow.com
Related Query
- Highcharts loaded via ajax, issue to dynamically create yAxis
- HighCharts load data via ajax
- Highcharts dynamically add/change yAxis plotLines
- Issue Dynamically Changing HighCharts Chart Title
- Highcharts yAxis text rotation issue in IE8
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Use ajax to draw graph dynamically using Highcharts
- How to construct HighCharts data series to match returned Json via ajax call
- Load CSV data via Ajax for display in Highcharts
- Highcharts low performance when adding yAxis dynamically
- How do I dynamically change the yAxis min, max and tickInterval in HighCharts
- Does HighCharts have an option to dynamically add plotLines to xAxis via datetime?
- JSON Data Map Issue with HighCharts + Ajax
- Have an issue with JavaScript, AJAX code displaying data
- Issue with Dates - trying to plot MongoDB data in Highcharts via PHP
- Highcharts yAxis self-adaption issue
- Create Highcharts bubble chart dynamically
- highcharts how to load data via ajax
- Animation for dynamically loaded new data with Highcharts
- Dynamically update highcharts via setData for Yii-created Highcharts Widget
- How to refresh highcharts (pie chart) data via ajax
- Dynamically adjust Y axis min/max based on ajax update and data points in Highcharts
- Highcharts cloud issue with data source when duplicating chart
- Highcharts generated from HTML table: Can't add second yAxis dynamically
- Decimals on yAxis are not being displayed, even if that same code works on highcharts jsfiddle
- dynamically generating json from json for highcharts heap map chart using ajax
- create column chart in highcharts dynamically from json data
- Issue while Dynamically Modifying yAxis Extremes in Highchart
- update the yAxis min value and tooltip dynamically in highcharts
- Highcharts ajax loaded tool tip
More Query from same tag
- HighCharts getJson - Unable to display
- TypeError: Cannot read property 'nodeName' of null
- Highcharts : Change color of series when hovering other series
- HighChart / HighStock chart.refresh seems to fail to reload the chart
- The last label on xaxis disappears partly in Highcharts
- when is a highchart completely loaded?
- How to style images in highcharts flags?
- Highcharts - Resizing Columns to Fix Data Label
- Highcharts showing nearest point causes flickering crosshair and strange order
- Datetime format for series - Highcharts
- Problems with retrieving mysql data into javascript in a specific format
- Highchart Hide/Remove Annotation buttons on export
- Highcharts: Displaying Linechart with missing datapoints
- Alias "ext.highcharts.HighchartsWidget" is invalid error in yii highchart
- Highcharts, how to change hover bg color for series with multiple columns (categories)
- Create a Highcharts Pie Chart Legend Inside a Table
- Highcharts Chart inside of a Highslide popout
- Ignore tfoot table rows when creating Highcharts from HTML table
- Rails Highstock Chart Installation
- Putting select element to div with z-index position to Highcharts container
- Problems with connecting series
- Highcharts: create multiple series using JSON data
- Highcharts item width not 100% in carousel
- Display the sum of track values in activity gauge inner radius while rendering
- Highcharts: Disable animation for specific event
- Trying to append arrays to highcharts ( jquery)
- Which web charting libraries export well with Wicked PDF?
- hightcharts: change standard position of tooltip AND shadow (hover)
- highcharts drilldown not working
- Highcharts display value of the average with addPlotLine