彩票走势图

Highcharts错误代码指示合集

原创|使用教程|编辑:龚雪|2014-08-11 10:02:17.000|阅读 1109 次

概述:本文整理了10个Highcharts报错代码,涉及Highcharts的数轴值、数据量、图表渲染器、数据类型、数据排序、坐标轴等错误。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

我们在使用Highcharts的时候,常常会报错,小编整理了10个报错代码供大家参考查阅。

Error #1 

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

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

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

Error #2  

数据量超过

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

Error #3

图表 div 渲染容器不存在

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

Error #4

数据类型错误,需要的是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 run parseFloat on the parsed value.

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

Error #5

未排序的数据

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 #6  

Highcharts 重复定义

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

Error #7

指定的数据列类型不存在

This error happens when you are setting chart.type or series.type to 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 an arearange series you need to load the highcharts-more.js file.

Error #8

指定的数轴不存在

This error happens when you set a series' xAxis or yAxis property to point to an axis that does not exist.

Error #9

坐标轴间隔过多

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 a tickInterval that is too small for the data value range. In general,tickPixelInterval is 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 #10

不能为长数据添加对象配置

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.

>>Highcharts下载


标签:JavaScript HTML5图表highcharts

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn


为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP