如何使用rowsUrl显示多个系列?
Highcharts.chart('container', {
chart: {
type: 'spline'
},
title: {
text: 'Live Data (Rows JSON)'
},
subtitle: {
text: 'Data input from a remote JSON file'
},
data: {
rowsURL: 'https://demo-live-data.highcharts.com/time-rows.json',
firstRowAsNames: false,
enablePolling: true
}
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
使用seriesMapping
属性:
data: {
...,
seriesMapping: [{
x: 0,
y: 1
}, {
x: 0,
y: 2
}]
}
现场演示:https://jsfiddle.net/BlackLabel/k8gt2vLp/
API:https://api.highcharts.com/highcharts/data.seriesMapping