显示多个数据集chart.js ajax和日期

时间:2019-09-27 16:43:33

标签: javascript chart.js

我在显示带有chart.js(样式=线)的多数据集时遇到问题。

我已经作为X轴约会了。

作为数据,我要进行多次审核。

我想将沃尔特和戴维德这两行与日期联系起来

我创建了这样的标签数组:

labels: ["January 2019", "February 2019", "March 2019", "April 2019","May 2019","June 2019","July 2019","August 2019", "September 2019", "October 2019","November 2019","December 2019"]

我有一个像这样的ajax动态json回复

[{mese: "May 2019", audit: "1", am: "walter"}
 {mese: "September 2019", audit: "20", am: "davide"}
 {mese: "September 2019", audit: "3", am: "walter"}]

我试图用javascript管理ajax的结果来创建两个这样的数组数据集

davide =[0,0,0,0,0,0,0,0,20,0,0,0]
walter =[0,0,0,0,1,0,0,0,3,0,0,0]

但是我不能。因此,根据月份,数据位置不正确。 一个办法? 谢谢你!

0 个答案:

没有答案