问题
I have a c3/d3 step chart with some boolean values. Now I need to align the step change on the actual event timestamp and not in the middle of that event.
Is there any config option so c3 step chart changes the line from 0 to 1 exactly when the event occurs?
回答1:
It seems that you're talking about line.step.type option:
var chart = c3.generate({
data: {
columns: [
['data1', 300, 350, 300, 0, 0, 100]
],
types: {
data1: 'step'
}
},
// that's it:
line: {
step: {
type: 'step-after'
}
}
});
来源:https://stackoverflow.com/questions/46162507/c3-step-chart-align-on-event