Type/to search
17
Follow
35
Followers
二重座標ポリライン
Help
Created 2019-05-26 07:49:19  
 1
 1915

押すHighchartsの例として双座標軸が表示される.
実現できないのです
なぜか?

var chart = { // 这个 chart 在JS 语言中 是对象, 在使用Chart 函数之前我们需要声明一个配置图表的对象变量chart。 __isStock: true, // 标记是否为一般图表,有兴趣的可以改成 false 运行看看。 tooltip: {xDateFormat: '%Y-%m-%d %H:%M:%S, %A'}, // 缩放工具 title : { text : '双坐标折线'}, // 标题 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: 3, inputEnabled: true }, xAxis: { type: 'datetime'}, // 坐标轴横轴 即:x轴, 当前设置的类型是 :时间 yAxis : [{ // Primary yAxis // 坐标轴纵轴 即:y轴, 默认数值随数据大小调整。 labels: { format: '{value}USDT', }, title: { text: 'BTC', } }, { // Secondary yAxis title: { text: 'ETH', }, labels: { format: '{value} USDT', }, opposite: true }], series : [ // 数据系列,该属性保存的是 各个 数据系列(线, K线图, 标签等..) {name : "line1", id : "线1,buy1Price", data : []}, // 索引为0, data 数组内存放的是该索引系列的 数据 {name : "line2", id : "线2,lastPrice", dashStyle : 'shortdash', data : []}, // 索引为1,设置了dashStyle : 'shortdash' 即:设置 虚线。 ] }; function main(){ var ObjChart = Chart(chart); // 调用 Chart 函数,初始化 图表。 ObjChart.reset(); // 清空 while(true){ var nowTime = new Date().getTime(); // 获取本次轮询的 时间戳, 即一个 毫秒 的时间戳。用来确定写入到图表的X轴的位置。 var ticker0 = _C(exchanges[0].GetTicker); // 获取行情数据 var ticker1 = _C(exchanges[1].GetTicker); // 获取行情数据 ObjChart.add([0, [nowTime, ticker0.Last]]); // 用时间戳作为X值, 买一价 作为Y值 传入 索引0 的数据序列。 ObjChart.add([1, [nowTime, ticker1.Last]]); // 同上。 Sleep(2000); } }

リアルディスク効果

Related Recommendations
Comment
All comments (1)

    series没有指定要用哪根Y轴 比如加上 yAxis: 1

    {name : "line2", id : "线2,lastPrice", dashStyle : 'shortdash', data : [], yAxis: 1},
    7 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)