rails-使用highcharts适配器检测到的系列的图表脚设置颜色

时间:2019-03-14 03:10:37

标签: ruby-on-rails chartkick

我对Chartkick有问题。我尝试为图表中的系列设置颜色。它与类型表是线一起工作。但是使用图表类型为列时,它将无法正常工作。

数据:

  

[{“ name”:“ Australia”,“ data”:[[1493571600000,656],[1496250000000,791],[1498842000000,899],[1501520400000,998],[1504198800000,1098],[1506790800000 ,1222],[1509469200000,1222],[1512061200000,1222],[1514739600000,1222],[1517418000000,1222],[1519837200000,1222],[1522515600000,1222],[1525107600000,1222]],“标记” :{“ symbol”:“ circle”},“ _ colorIndex”:1},{“ name”:“ United   王国”,“数据”:[[1493571600000,69],[1496250000000,77],[1498842000000,79],[1501520400000,96],[1504198800000,138],[1506790800000,230],[1509469200000,230], [1512061200000,230],[1514739600000,230],[1517418000000,230],[1519837200000,230],[1522515600000,230],[1525107600000,230]],“标记”:{“ symbol”:“ circle”} ,“ _ colorIndex”:1},{“ name”:“新加坡”,“数据”:[[1493571600000,183],[1496250000000,201],[1498842000000,229],[1501520400000,239],[1504198800000,253 ],[1506790800000,255],[1509469200000,255],[1512061200000,255],[1514739600000,255],[1517418000000,255],[1519837200000,255],[1522515600000,255],[1525107600000,255]] ,“ marker”:{“ symbol”:“ circle”},“ _ colorIndex”:2},{“ name”:“ Netherlands”,“ data”:[[1493571600000,164],[1496250000000,174],[1498842000000 ,194],[1501520400000,202],[1504198800000,206],[1506790800000,208],[1509469200000,208],[1512061200000,208],[1514739600000,208],[1517418000000,208],[1519837200000,208 ],[1522515600000,208],[1525107600000,208]],“标记”:{“符号”:“圆圈”},“ _ colorIndex”:3}]

我尝试使用Highchart js,它运行良好。我不明白为什么它不能与Chartkick Highchart适配器一起使用。我无法设置“库”,因为我使用Ajax来获取和设置图表数据。

0 个答案:

没有答案