我的 CSV 数据的时间序列图生成重叠条。图书馆有问题吗?附加图像、我的代码和我的 CSV 数据(在代码中使用之前将其解析为 JSON final_data
)。
var chart = c3.generate({
bindto: '#chart',
data: {
x: 'date',
xFormat: '%m/%d/%y %I:%M %p',
json: final_data,
keys: {
x: 'date',
value: values
},
type: 'bar',
groups: val
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%b %d',
centered: true,
fit: true
}
}
},
zoom: {
enabled: true
},
color: {
pattern: colors
}
});
这是我拥有的 CSV 数据。
Time Series,Category,Duration
6/24/15 12:00 AM,Post Processor,0
6/24/15 12:00 AM,Response Processing,8
6/24/15 12:00 AM,External Calls,168
6/24/15 12:00 AM,Internal Processing,16
6/24/15 12:00 AM,Pre Processor,0
10/1/14 12:00 AM,Post Processor,0
10/1/14 12:00 AM,Response Processing,0
10/1/14 12:00 AM,External Calls,0
10/1/14 12:00 AM,Internal Processing,5
10/1/14 12:00 AM,Pre Processor,0
5/15/15 12:00 AM,Post Processor,0
5/15/15 12:00 AM,Response Processing,0
5/15/15 12:00 AM,External Calls,0
5/15/15 12:00 AM,Internal Processing,5
5/15/15 12:00 AM,Pre Processor,0