Glavin001 / ember-c3

:chart_with_upwards_trend: Ember addon library for C3, a D3-based reusable chart library.
http://glavin001.github.io/ember-c3/
MIT License
81 stars 60 forks source link

Chart Bar highlight issue #112

Open amit199309 opened 2 years ago

amit199309 commented 2 years ago

Hi Guys,

Earlier we were using "ember-c3": "0.2.3" this version and here when we click on any chart bar item then there is highlight color for active bar to just show this bar clicked, But now we upgraded to "ember-c3": "^3.0.1" this version but there is no color when we click on any bar so here we are not able to represent when bar clicked.

Could anyone suggest how to overcome this issue with "ember-c3": "^3.0.1" version ?

Thank you

maxwondercorn commented 2 years ago

@amit199309 Sorry for late response. 0.2.3 is pretty old but generally the current version has the same functionality with added features.

I believe you're asking about enabling C3's data selection property which changes the selected bar color? Or are you doing something with events?

If you want to enable the selection property you can add it to your data payload. The snippet below is using column based data but adding selection: { enabled: true } any data will enable this feature.

  const data = {
    columns: [
      ['data1', 30],
      ['data2', 120]
    ],
    selection: {
      enabled: true
    },
    type: 'donut'
  };

If you were using events or something else you may need to provide a snippet to see how you were doing it.