c3 icon indicating copy to clipboard operation
c3 copied to clipboard

Update Name

Open nathancole opened this issue 12 years ago • 4 comments

How do you update the name for a data set once the chart has been created?

nathancole avatar Mar 31 '14 02:03 nathancole

Hi @nathancole ,

I added an API for updating data names. I think this can be used for your purpose. Sample is here http://c3js.org/samples/api_data_name.html and please check this.

Thank you.

masayuki0812 avatar Mar 31 '14 07:03 masayuki0812

This looks good. The only problem I'm having now is that it updates all of the names even if you are only changing 1. The following results in data1 also being set back to "Data 1" even if it had been named something else initially.

chart.data.names({ data2: "New Name" });

nathancole avatar Mar 31 '14 14:03 nathancole

Hi,

Thank you for the suggestion. I fixed to accept individual name for the data. I also updated the sample - http://c3js.org/samples/api_data_name.html Could you try on the latest version again?

Thank you.

masayuki0812 avatar Apr 01 '14 01:04 masayuki0812

This looks great. Thanks again for your great work. Hopefully I can help contribute some once I get more familiar with the setup of the project.

nathancole avatar Apr 01 '14 02:04 nathancole