我是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)
]
});
任何人都可以帮助我做错了什么或纠正我将不胜感激。
1条答案
按热度按时间cgvd09ve1#
对于潮汐样式的线,请使用
spline
系列类型:Demo:https://jsfiddle.net/BlackLabel/wLbqt5np/
API引用:https://api.highcharts.com/highcharts/series.spline