javascript 使用HighChart的每周潮汐图和每小时潮汐图

sdnqo3pr  于 2023-06-28  发布在  Java
关注(0)|答案(1)|浏览(123)

我是HighChart Js的新手,我想在HighCharts中绘制一个Tidechart。
我需要一些输出,如以下截图:Chart Screenshot
我试过下面的链接:Here
但我得到的结果是:MyCodeResult

Highcharts.chart('container', {
  chart: {
    type: 'line'
  },
  title: {
    text: 'Weekly Tide Chart'
  },
  xAxis: {
    categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
    title: {
      text: 'Day of the Week'
    }
  },
  yAxis: {
    title: {
      text: 'Tide Level'
    }
  },
  series: [
    {
      name: '12 AM',
      data: [3.2, 3.5, 3.8, 2.9, 2.4, 3.1, 3.6] // Will be Replaced with my actual tide data for each hour of the day (e.g., Monday, 12 AM)
    },
    {
      name: '1 AM',
      data: [3.1, 3.3, 3.7, 2.8, 2.3, 3.2, 3.5] // Will be Replaced with my actual tide data for each hour of the day (e.g., Monday, 1 AM)
    },
    // Will Repeat the above data series for each hour of the day (e.g., 2 AM, 3 AM, ..., 11 PM)
  ]
});

任何人都可以帮助我做错了什么或纠正我将不胜感激。

相关问题