c3 icon indicating copy to clipboard operation
c3 copied to clipboard

Formatting value labels displayed on chart

Open nathancole opened this issue 12 years ago • 2 comments

Is it currently possible to format the values displayed for the labels on the chart? If not, would it be easy to implement? For example, instead of .953362321 I might like to display .95. See the chart below for an example.

c3chart

nathancole avatar Apr 01 '14 03:04 nathancole

I added data.labels.format.y and data.labels.format.y2 options and I think you can use this for your purpose by setting a function returning formatted string.

I also added a sample, please check this: https://github.com/masayuki0812/c3/blob/master/htdocs/samples/data_label_format.html

Could you try these?

masayuki0812 avatar Apr 01 '14 14:04 masayuki0812

This looks great! Thank you sir!

nathancole avatar Apr 02 '14 02:04 nathancole