Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HighCharts:向点添加不同类型的数据_Javascript_Json_Highcharts - Fatal编程技术网

Javascript HighCharts:向点添加不同类型的数据

Javascript HighCharts:向点添加不同类型的数据,javascript,json,highcharts,Javascript,Json,Highcharts,根据HighChart,Api点有几个变量: 颜色数据标签x、y、向下展开、事件。。。等 是否有任何方法向点添加额外变量,以便在javasciprt函数中访问这些点: 同样的事情在系列中也是可能的 例如: PHP JSON输出 {leagueID: '1' ,data:[{"x":1395180000000,"y":85.28,"credit":35,"income":120.28} JavaScript events: { click: function() { pr

根据HighChart,Api点有几个变量:

颜色数据标签x、y、向下展开、事件。。。等

是否有任何方法向点添加额外变量,以便在javasciprt函数中访问这些点:

同样的事情在系列中也是可能的

例如:

PHP

JSON输出

{leagueID: '1' ,data:[{"x":1395180000000,"y":85.28,"credit":35,"income":120.28}
JavaScript

events: {
    click: function() {
        profit_company_change(this.series.options.leagueID);//It is possible, it can find this.series.options.leagueID)
JavaScript 2

 ...+ '$</b><br/>Tatal credit: <b>' + this.credit +'$</b><br/>Profit: <b>'+ this.y ; // This is not possible because of this.credit
…+'$
国家信用:'+this.credit+'$
利润:'+this.y;//因为这个原因,这是不可能的
您可以使用以下内容:

series:[{
  data:[{
    y:20,
    customParameter: 'loreum ipsum'
   },1,2,3]
}]

然后,该参数将在point.options对象中可用。

我如何使用json编码的数组创建一个没有“的变量。此外,为什么它可以找到“x”:但找不到“CutParameter”:我的其余代码保持不变;解决方案只是;只需使用这个.point.options.customworks就可以了,谢谢。我试图表示它(customParameter)可以介于“之间”。我对此感到惊讶:它适用于这个.x,但不适用于这个.customParameter,感谢您的回答,我意识到它应该是这个.point.options.customParameter。
series:[{
  data:[{
    y:20,
    customParameter: 'loreum ipsum'
   },1,2,3]
}]