如何在Google Charts API中创建价格图表?

时间:2016-12-20 21:21:43

标签: javascript html charts google-api google-visualization

查看此页面上的第一个图表:http://viewcoin.com/charts

基本上,第一张图表应显示历史价格的折线图:

<div width="960" height="320" 
    data-chart-type="LineChart" 
    data-datasets='{"Price":{"15659":["2012-11-15T00:00:00.000Z",0.05],"15685":["2012-12-11T00:00:00.000Z",0.05],"15686":["2012-12-12T00:00:00.000Z",0.05],"15714":["2013-01-09T00:00:00.000Z",0.05],"15718":["2013-01-13T00:00:00.000Z",0.3],"15722":["2013-01-17T00:00:00.000Z",0.3],"15735":["2013-01-30T00:00:00.000Z",0.37],"15797":["2013-04-02T00:00:00.000Z",0.3],"15893":["2013-07-07T00:00:00.000Z",0.3],"15895":["2013-07-09T00:00:00.000Z",0.3],"15900":["2013-07-14T00:00:00.000Z",0.2],"15987":["2013-10-09T00:00:00.000Z",0.2],"16017":["2013-11-08T00:00:00.000Z",0.1],"16077":["2014-01-07T00:00:00.000Z",0.11],"16081":["2014-01-11T00:00:00.000Z",0.1],"16082":["2014-01-12T00:00:00.000Z",0.11],"16163":["2014-04-03T00:00:00.000Z",0.1],"16174":["2014-04-14T00:00:00.000Z",0.1],"16339":["2014-09-26T00:00:00.000Z",0.1],"16721":["2015-10-13T00:00:00.000Z",0.1],"16763":["2015-11-24T00:00:00.000Z",0.1]}}' 
    data-use-previous-row='1' 
    class="chart">

问题是数据没有显示在图表上,因为它的日期是当前日期之前的日期。因此,所发生的情况是数据集中没有出现在图表中的点,作为副作用,价格点将全部为0而不是前一点(整个图表是平的)。

我的问题是:如何制作能够正确显示价格的Google图表(使用最新价格作为当前价格以及价格变动后的每一天)?

0 个答案:

没有答案