score:1
Accepted answer
i fixed the issue by adding the values to the chart as data [[x,y], [x,y], ...].
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id="container" style="position:absolute;bottom:0px;right:0px;left:0px;top:0px;"></div>
<script>
var data = [
['time', 'dataset 1', 'dataset 2'],
[0, 0,2],
[0.2, 2,3],
[0.3, 2.3,4.7],
[0.6, 2,6.2],
[1, 3.1, 3.1],
[3, 3.5, 3.0],
[3.4, 2.8, 1.7]
/* ... */
];
$(function () {
// reformat data
var seriesdata = [];
// add series json with nametag for every label
data[0].foreach(function(name) {
seriesdata.push({name: name, data: []});
});
// for every datum add it to the data field of the series data.
data.slice(1).foreach(function(datum) {
datum.foreach(function(item, i) {
seriesdata[i].data.push([datum[0],item]);
});
});
$('#container').highcharts({
chart: {
zoomtype: 'x'
},
title: {
text: 'title',
x: -20
},
xaxis: {
},
yaxis: {
plotlines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
legend: {
layout: 'vertical',
align: 'right',
verticalalign: 'middle',
borderwidth: 3
},
series: seriesdata.slice(1)
});
});
</script>
</body>
</html>
Source: stackoverflow.com
Related Query
- Hide axis and gridlines Highcharts
- Change HighCharts axis title
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- Highcharts Area graph, use 2 fill colors above / below X axis
- Highcharts y axis thousands separator
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Highcharts - set maximum range for yAxis but keep axis dynamic within that range
- Highcharts how to change x axis options
- Highcharts - How to start x axis from an arbitrary value
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Highcharts - Long multi-line y axis labels causing following label to be removed
- Highcharts - with datetime axis labels overlap
- Change Y Axis vertical line color in Highcharts
- How to add space between chart and axis in highcharts
- Highcharts reset y Axis
- highcharts - removing decimal places on Y axis with only one point
- Highcharts : hiding bottom-most x axis grid line
- How to change axis label size when exporting in Highcharts / Highstock
- Change HighCharts axis title in 2.1.4
- Highcharts axis label before first point
- Highcharts | Making multiple y axis scales
- Invert Y axis in Highcharts
- Highcharts blank chart with x and y axis
- Highcharts display series.name on X Axis
- Highcharts - Display only year in x axis and stop auto formatting
- Style highcharts x and y axis
- Highcharts label format with tickPositioner in a datetime x Axis
- Align y axis tick "outside" on highstock, so they are the same as on highcharts
- Dual axis using percentage and absolute value to same serie in Highcharts
More Query from same tag
- HighCharts navigator to keep range after async data load. (LazyLoad)
- JSON Highcharts to draw multiple lines
- Highchart, how to vertically align in the middle a line?
- How to remove the grid line overlappings in highcharts?
- Need to make each bar as series in highcharts
- can't get data from mysql in highchart
- highchart click event Brakedown browser in iphone
- Toggle between two values
- HighStock xDateFormat month name
- Zoom xy proportionally in Highcharts scatter plot
- Legends display order in piechart highcharts
- Highcharts: how do I align data labels on the right in a bar chart?
- Refreshing view on droplist onchange and keeping state
- dotnet highchart error, not showing data
- Tooltip in chart with line- and scatter plot in highcharts 3.0.7
- Highmaps: How to emphasize mapline
- Selecting relational highchart SVG images with Selenium
- Stacking Highcharts data in an xrange data series
- Highcharts - too many series are displayed
- Remove day name from highstock chart tooltip
- Column Highchart - display absolute values but keep information about which values are negative
- Is there a possibility to display regions in a detailed map (instead of cities)?
- vb.net getting data from datatable using array
- How to position custom tooltips on mouseover, equivalent to default tooltip by using chart.renderer.text on event load in chart property
- Javascript or other charting library for geodata
- How to use Highcharts.setOptions in react-highcharts?
- How to draw a background behind a plotLine label in a highstock chart
- jQuery pushing additional calculated data points to HighChart series
- highcharts can't work in website
- call to context menu function