Pascal
Pascal

Reputation: 2154

c3 step chart align on event

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?

enter image description here

Upvotes: 0

Views: 560

Answers (1)

Dmitry Demidovsky
Dmitry Demidovsky

Reputation: 8197

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'
      }
    }
});

Upvotes: 1

Related Questions