Closed literakl closed 3 years ago
A workaround is to instead of give the RGB HEX value submit the RGBA hex values. In that case you can see that both charts show the same color gradiant. Also for ease of work try to not hardcode your colors in the html but put them in your data and pass that variable in your html
See example: https://codesandbox.io/s/immutable-worker-3qxgj
Thank you. Your solution works! If you are on Stackoverflow, I just offered a bounty: https://stackoverflow.com/questions/64811140/differently-displayed-colors-on-chart-js
Describe the bug I have the same colors for two different charts: :colors="[['#28a745', '#007bff', '#ffc107', '#dc3545']]". I want the same colors to be displayed. Colors are different:
To reproduce
https://codesandbox.io/s/pensive-williamson-upohe?file=/src/components/HelloWorld.vue:37-400
"vue-chartkick": "^0.6.1", "chart.js": "^2.9.4",
Chartjs claims the problem lies in a wrapper: https://github.com/chartjs/Chart.js/issues/8046
HTML generated by Chartkick