資源の読み込みに... 荷物...

グラフオプション

このJSONは,カスタム・ドラッグ関数のチャート構成情報を設定するために使用されます.Chart(). 使用されているチャートライブラリはHighchartsです.ここにはいくつかの基本的な設定フィールドのみがリストされています.

プラットフォーム拡張フィールド.Highstocksチャートを使用するには true に設定; Highchartsチャートを使用するには false に設定.

__is ストック 文字列

{
    layout: 'single', // Not participating in grouping, displayed separately, default is group 'group'
    height: 300,      // Specify height
}

延長 JSON グラフのタイトル タイトル 文字列 X軸の配置 x軸 JSON Y軸の配置 y軸 JSON グラフデータシリーズ シリーズ JSON

簡単な図面の例です

// This chart is an object in JavaScript language. Before using the Chart function, we need to declare an object variable chart to configure the chart.
var chart = {                                           
    // This field marks whether the chart is a general chart. If you are interested, you can change it to false and run it.
    __isStock: true,                                    
    // Zoom tool
    tooltip: {xDateFormat: '%Y-%m-%d %H:%M:%S, %A'},    
    // title
    title : { text : 'Price difference analysis chart'},                       
    // Select range
    rangeSelector: {                                    
        buttons:  [{type: 'hour',count: 1, text: '1h'}, {type: 'hour',count: 3, text: '3h'}, {type: 'hour', count: 8, text: '8h'}, {type: 'all',text: 'All'}],
        selected: 0,
        inputEnabled: false
    },
    // The horizontal axis of the coordinate axis is: x-axis, and the current setting type is: time
    xAxis: { type: 'datetime'},                         
    // The vertical axis of the coordinate axis is: the y-axis, the default value is adjusted according to the data size
    yAxis : {                                           
        // title
        title: {text: 'Price difference'},                           
        // Whether to enable the right vertical axis
        opposite: false                                 
    },
    // Data series, this property saves each data series (line, K-line chart, label, etc.)
    series : [                                          
        // The index is 0, and the data array stores the data of the index series.
        {name : "line1", id : "line 1,buy1Price", data : []},                          
        // The index is 1, dashStyle:'shortdash' is set, that is, a dashed line is set
        {name : "line2", id : "line 2,lastPrice", dashStyle : 'shortdash', data : []}  
    ]
}
function main(){
    // Call the Chart function to initialize the chart
    var ObjChart = Chart(chart)         
    // Clear
    ObjChart.reset()                      
    while(true){
        // Get the timestamp of this poll, which is a millisecond timestamp. Used to determine the position of the X-axis written to the chart
        var nowTime = new Date().getTime()
        // Get market data
        var ticker = _C(exchange.GetTicker)
        // Get the buy price from the return value of the market data
        var buy1Price = ticker.Buy    
        // Get the last transaction price. In order to prevent the two lines from overlapping, we add 1.
        var lastPrice = ticker.Last + 1
        // Use the timestamp as the X value and the buy price as the Y value to pass into the data sequence of index 0
        ObjChart.add(0, [nowTime, buy1Price])
        // Same as above
        ObjChart.add(1, [nowTime, lastPrice])
        Sleep(2000)
    }
}

{@fun/Log/チャート・チャート}

ログステータス-btnタイプ2 KLineChart-オプション