2016-07-29 3 views
0

私の剣道グラフのカスタムy-asを使用しようとしています。これが関数です。剣道グラフの参照エラー

function FormatLongNumber(value) { 
    if(value == 0) { 
    return 0; 
    } 
    else 
    { 
     // for testing 
     //value = Math.floor(Math.random()*1001); 

     // hundreds 
     if(value <= 999){ 
     return value; 
     } 
     // thousands 
     else if(value >= 1000 && value <= 999999){ 
     return (value/1000) + 'K'; 
     } 
     // millions 
     else if(value >= 1000000 && value <= 999999999){ 
     return (value/1000000) + 'M'; 
     } 
     // billions 
     else if(value >= 1000000000 && value <= 999999999999){ 
     return (value/1000000000) + 'B'; 
     } 
     else 
     return value; 
    } 
} 

とするとき、私はこれを使用して、私の剣道グラフ上でこれを使用したい:私は次のエラーを取得するアプリケーションを実行すると

valueAxis: { 
     labels: { 
      visible: true, 
      //format: ValueAxisLabelsFormat, 
      template: "#= FormatLongNumber(value) #" 
     } 
    }, 

ReferenceError: FormatLongNumber is not defined 

私は間違っていますか?

+0

'関数ですFormatLongNumber'角度範囲内か外で定義されましたか? – Philipp

+0

スコープ外では、関数activate(){}の後に定義されています – Fearcoder

答えて

関連する問題