c3 step chart align on event

落爺英雄遲暮 提交于 2020-01-07 07:41:19

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!