Can any one suggest me the way of adding title to the C3.js line and bar charts ? I have got the following sample but it is for gauge chart. For any c3 chart is there any option to set the chart title?
donut: {
title: 'Title'
}
The example below would enable a title of 'Custom Chart Title' on the chart that is created. const chart = new Chart(ctx, { type: 'line', data: data, options: { plugins: { title: { display: true, text: 'Custom Chart Title' } } } }); Copied!
This library is used to create a dynamic and interactive data visualizations. C3 is a library build on top of D3. C3 is d3 based reusable chart library and most important advantage of using c3 is that you don't have to know D3 or write those long codes!.
js is a JavaScript library for manipulating documents based on data. c3. js is a Javascript library which makes it easy to generate D3-based charts (less code to write). highchart is a Javascript charting framework.
This was a top google result, so I thought I'd add that this is now part of the library:
title: {
text: 'My Title'
}
More info @ https://github.com/masayuki0812/c3/pull/1025
You'd need to fall back to using D3 to add a chart title. Something like:
d3.select("svg").append("text")
.attr("x", 100 )
.attr("y", 50)
.style("text-anchor", "middle")
.text("Your chart title goes here");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With