2014-04-01 40 views
0

根據HighChart阿比點有幾個變量:HighCharts:Addding不同類型的數據來分

顏色dataLabels X,Y,深入分析,事件...等

是否有任何的方式來增加額外的變量要以點在javasciprt功能達到這些目標:

同樣的事情是可能的系列...

例子:

PHP

array_push($finalArray,array(x=> $date,y => ($total_income - $total_cost), credit => $total_cost, income => $total_income)); 
... 
echo "leagueID: '" . $leagueID ."' ," ; 
echo "data:" ; 
echo json_encode($finalArray) . "},"; 

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 

回答

0

您可以使用這樣的事情:

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

然後這個參數將在point.options對象中可用。

+0

我怎麼可以不發一變量「使用JSON編碼的陣列另外它爲什麼能找到。‘X’:但找不到‘cutomParameter’: – guemues

+0

我的代碼休息的相同的休息;該解決方案是唯一的; 剛使用這個**。point。** options.custom – guemues

+0

那麼現在它的工作與否? –