jettro / c3-angular-directive

Contains angularjs directives that use c3js to create good looking graphs
http://jettro.github.io/c3-angular-directive/
MIT License
203 stars 98 forks source link

Struggling to implement chart-data for bar charts #135

Open zukilover opened 8 years ago

zukilover commented 8 years ago

Hi @jettro , could you please show me how to implement bar charts with categories, using dynamic chart data attribute?

I've managed to come up with this result: https://drive.google.com/file/d/0B-hbE9qIaT7kd0Q5dFVZUzkxamc/view?usp=drivesdk but failed to apply the custom axis-x custom labels. I want to show "Period 1, Period 2", Instead of 0, 1, ...

My JSON file looks like so: { "cashFlow" : [{ "Period 1" : { "Cash In" : 30, "Cash Out" : 50 }, "Period 2" : { "Cash In" : 60, "Cash Out" : 50 } }] }

anukiransolur commented 7 years ago

add axis type in chart-axis-x

anukiransolur commented 7 years ago

<chart-axis-x axis-id="x" axis-position="outer-center" axis-label="x-lable" axis-type="category"></chart-axis-x>