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],         }     } }); 

see http://c3js.org/samples/categorized.html


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -