我正在使用 angular 图表中的时间轴系列
我一步一步地跟着,但我得到了错误,我不明白错误有人可以帮助我这对我的项目很重要,或者可以建议我图书馆或其他任何有角度的时间线
html:
<div id="container"></div>
代码:
timeLine(){
Highcharts.chart('container', { << error in container
chart: {
type: 'timeline'
},
xAxis: {
type: 'datetime',
visible: false
},
yAxis: {
visible: false
},
title: {
text: 'Timeline of Space Exploration'
},
subtitle: {
text: 'Info source: <a href="https://en.wikipedia.org/wiki/Timeline_of_space_exploration">www.wikipedia.org</a>'
},
series: [{
dataLabels: {
allowOverlap: false,
connectorColor: 'silver',
connectorWidth: 2
},
marker: {
symbol: 'circle'
},
useHTML: true,
data: [{
name: 'First dogs <span style="font-family: FontAwesome; color:red">\uf1b0</span>',
label: '1951: First dogs in space',
description: '22 July 1951 First dogs in space (Dezik and Tsygan) '
}, {useHTML: true,
name: 'Sputnik 1 <span style="font-family: FontAwesome; color:red">\uf135</span',
label: '1957: First artificial satellite<i class="fas fa-satellite"></i>',
description: '4 October 1957 First artificial satellite. First signals from space.'
}, {
name: 'First human spaceflight <span style="font-family: FontAwesome; color:red">\uf183</span>',
label: '1961: First human spaceflight (Yuri Gagarin)',
description: 'First human spaceflight (Yuri Gagarin), and the first human-crewed orbital flight'
}, {
name: 'First human on the Moon <span style="font-family: FontAwesome; color:blue">\uf186</span>',
label: '1969: First human on the Moon',
description: 'First human on the Moon, and first space launch from a celestial body other than the Earth. First sample return from the Moon.'
}]
}]
});
}
错误:我不明白错误以及我应该怎么做?
586:22 - error TS2769: No overload matches
this call.
Overload 1 of 2, '(options: Options, callback?: ChartCallbackFunction): Chart', gave the following error.
Type '"container"' has no properties in common with type 'Options'.