JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Charts & Data Viz › Pie charts : I don’t succed in using addColorScheme › Reply To: Pie charts : I don’t succed in using addColorScheme
December 5, 2023 at 1:13 pm
#109251
fabriceb
Participant
Hi I reply to myself, after using the Chat with Peter (Thanx Peter 😉 )…
The problem was just that the component was not already loaded.
in the codepen, I just have to add addColorScheme in window.onload :
window.onload = () => {
oChart3.addColorScheme(‘custom’, aCustomColors);
oChart3.colorScheme = ‘custom’;
}
On my project, I was using the code in document.ready() : and it didn’t work.
I replaced document.ready() with window.onload = (), and it works fine now.
fabriceb