JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Charts & Data Viz Pie charts : I don’t succed in using addColorScheme

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #109250
    fabriceb
    Participant

    Hello,

    I need to apply a custom colorscheme on my Pie Chart.

    I’m using HTMLElements by using myElement = new smart. ………

    I tried to use your example : https://www.htmlelements.com/demos/chart/color-schemes/index.js

     

    But I don’t succed in using addcolorscheme function.

    The only way to force my customScheme is to use a function inside seriesGroupe:[{series{…}}]

    But I want to know why addColorscheme doesn’t work in my case…

     

    Here is the codepen to test :

    https://codepen.io/mogador/pen/yLZGgRw?editors=1111

     

    Thanx,

     

    fabriceb

    #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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.