Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change donut title (Interior text) dynamically with chart loads #1388

Open
kethomassen opened this issue Sep 21, 2015 · 4 comments
Open

Change donut title (Interior text) dynamically with chart loads #1388

kethomassen opened this issue Sep 21, 2015 · 4 comments

Comments

@kethomassen
Copy link

Is there a way to make the title inside the donut chart change to the sum of all the data values, updating automatically with every data load into the chart?

@vishal-kony
Copy link

You can use this to change the title dynamically.
d3.select('#div_id .c3-chart-arcs-title').node().innerHTML = "new title";

where div_id is the id of the div to which your chart is bounded.
you may have to write the logic to calculate sum on your own

@asadchachar
Copy link

and how can we change font and color dynamically?

@AfzalH
Copy link

AfzalH commented Sep 28, 2017

I was able to do it following vishal-kony's advice.
However it will be better if c3 library provides an API for this. Something like
chart.updateTitle('donut','new title');

@mpushki
Copy link

mpushki commented Apr 21, 2021

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants