angular - Highchart - 预期的类型来自属性 'dashStyle',它在类型 'XAxisPlotLinesOptions' 上声明
问题描述
我xAxis
在 highchart 中添加了以下代码。
plotLines: [
{
color: 'grey',
width: 2,
dashStyle: 'line'
}
],
我得到下面的图表,以前我dashStyle
在其他工作中使用过,这里只有我得到下面的问题。
error TS2769: No overload matches this call.
Overload 1 of 2, '(options: Options, callback?: ChartCallbackFunction): Chart', gave the following error.
Type '"trgt-testcntrl"' has no properties in common with type 'Options'.
Overload 2 of 2, '(renderTo: string | HTMLElement, options: Options, callback?: ChartCallbackFunction): Chart', gave the following error.
Type '"line"' is not assignable to type 'DashStyleValue'.
node_modules/highcharts/highcharts.d.ts:115249:5
115249 dashStyle?: DashStyleValue;
~~~~~~~~~
The expected type comes from property 'dashStyle' which is declared here on type 'XAxisPlotLinesOptions'
我在这里做错了什么?
解决方案
没有像line
.
在 API 参考中,您可能会找到可用的。
API:https
://api.highcharts.com/class-reference/Highcharts#.DashStyleValue
演示:https ://stackblitz.com/edit/highcharts-angular-basic-line-dztepl
推荐阅读
- java - Android将触摸事件传递给孩子
- html - 无法使用两种方式绑定以正确的格式显示数据
- node.js - Mongoose / 查找文档并从数组中提取对象
- javascript - 业力测试:合成属性@transitionMessages。请在您的应用程序中包含“BrowserAnimationsModule”或“NoopAnimationsModule”
- python-3.x - 将 1d numpy ndarray 转换为形状为 (n,2) 的热编码 ndarray
- javascript - 使用函数和循环拼接字符串值并存储为数组
- php - Laravel 图像干预错误
- c++ - 类封装在命名空间后,友元函数不能再访问类的私有数据成员
- php - 只读下拉 Codeigniter
- groovy - Jmeter Groovy 通过从前一个列表迭代创建新列表