score:1

Accepted answer

You need to map your data to the format required by Highcharts. In your case:

  • an array of arrays with [x, y] values:

    series: [{
      data: jsonData2.time.map((x, index) => [x, jsonData2.volt[index]])
    }]
    
  • or an array of objects with { x, y } values:

    series: [{
      data: jsonData2.time.map((x, index) => ({ x: x, y: jsonData2.volt[index]}))
    }]
    

Live demo: https://codesandbox.io/s/fancy-cloud-mx9z-mx9ze?file=/index.js

API Reference: https://api.highcharts.com/highcharts/series.line.data


Related Articles