javascript - How to Plot x,y coordinates in c3.js chart library? -
how can pass x,y values generate chart x values not automatically sorted? if use example x starts on 2 because lowest value.
var chart = c3.generate({ data: { x: 'x', columns: [ ['x', 50, 80, 2,100, 230, 300], ['data1',400, 200, 100, 50, 25, 12] ] }
});
if want not sort x values, need treat category axis
var chart = c3.generate({ data: { columns: [ ['data1',400, 200, 100, 50, 25, 12] ], type: "bar", }, axis: { x: { type: 'category', categories: [50, 80, 2,100, 230, 300], } } });
Comments
Post a Comment