Highcharts 异常码

本文列举并解释了Highcharts在使用过程中可能出现的各种错误代码及其原因,包括数值问题、数据量过大、图表渲染容器缺失等,并提供了相应的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Highcharts 异常码


Error #10

对数轴的值不能为 0 或负数

下述情况下会发生这个错误:

  • 在对数坐标轴中出现值为 0 或负数的情况
  • 对数轴的最小值为0 或 小于 0
  • 阀值(threshold)设置为 0 或小于 0

Error #12

数据量超过

This error occurs if theseries.dataoption contains object configurations and the number of points exceeds theturboThreshold. It can be fixed by either setting theturboThresholdoption to a higher value, or changing your point configurations to numbers or arrays. SeeturboThreshold

.
Error #13

图表 div 渲染容器不存在

This error occurs if thechart.renderTooption is misconfigured so that Highcharts is unable to find the HTML element to render the chart in.


Error #14

数据类型错误,需要的是Number类型,传入的却是String

This happens if you pass in a string as a data point, for example in a setup like this:

series: [{
	data: ["3", "5", "1", "6"]
}]

Highcharts expects the data values to be numbers. The most common reason for this is that data is parsed from CSV or from a XML source, and the implementer forgot to runparseFloaton the parsed value.

For performance reasons internal type casting is not performed, and only the first value is checked (since 2.3).


Error #15

未排序的数据

This happens when you are trying to create a line series or a stock chart where the data is not sorted in ascending X order. For performance reasons, Highcharts does not sort the data, instead it is required that the implementer pre-sorts the data.


Error #16

Highcharts 重复定义

This error happens the second time Highcharts or Highstock is loaded in the same page, so theHighchartsnamespace is already defined. Keep in mind that theHighcharts.Chartconstructor and all features of Highcharts are included in Highstock, so if you are runningChartandStockChartin combination, you only need to load the highstock.js file.


Error #17

指定的数据列类型不存在

This error happens when you are settingchart.typeorseries.typeto a series type that isn't defined in Highcharts. A typical reason may be that your are missing the extension file where the series type is defined, for example in order to run anarearangeseries you need to load thehighcharts-more.jsfile.


Error #18

指定的数轴不存在

This error happens when you set a series'xAxisoryAxisproperty to point to an axis that does not exist.


Error #19

坐标轴间隔过多

This error happens when you try to apply too many ticks to an axis, specifically when you add more ticks than the axis pixel length. In practice, it doesn't make sense to add ticks so densely that they can't be distinguished from each other. One cause of the error may be that you set atickIntervalthat is too small for the data value range. In general,tickPixelIntervalis a better option, as it will handle this automatically. Another case is if you try to set categories on a datetime axis, which will result in Highcharts trying to add one tick on every millisecond since 1970.


Error #20

Can't add object point configuration to a long data series

In Highstock, if you try to add a point using the object literal configuration syntax, it works only when the number of data points is below the series'turboThreshold. Instead of the object syntax, use the Array syntax.


转载: http://www.hcharts.cn/resource/errors.php
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值