coreui / coreui-chartjs

Chart.js custom tooltips designed for CoreUI Templates
MIT License
8 stars 24 forks source link

Tooltips not working properly for line chart #17

Open sibidharan opened 1 year ago

sibidharan commented 1 year ago

On line charts, it works very well.

Screenshot 2022-08-04 at 6 17 30 AM

On bar charts, the color is not being displayed in the tooltip.

Screenshot 2022-08-04 at 6 18 23 AM

Is there any way to fix this?

sibidharan commented 1 year ago

@mrholek any fix for this?

xidedix commented 1 year ago

@sibidharan you should pass pointBackgroundColor in your dataset for CChartLine like:

<CChartLine
  ...
  data={{
    ....
    datasets: [
      {
        backgroundColor: 'transparent',
        borderColor: '#321fdb',
        borderWidth: 2,
        data: [41, 78, 51, 66, 74, 42, 89, 97, 87, 84, 78, 88, 67, 45, 47],
        pointBackgroundColor: '#321fdb'
      },
    ],
  }}
...

image