khoff18
Posts: 2
Joined: Thu Oct 14, 2021 8:52 pm

Pattern Issue - won't switch back to colors

I'm having an issue with the pattern-fill. I'm using a checkbox to get the patterns to show up and that works great but I can't get the colors to show back up. This project is in Angular so I'm using the updateFlag when setting the series array and console logging the chartOptions to make sure the series.data is changing correctly which it definitely appears to be but obviously I'm missing something. Here is the codesandbox https://codesandbox.io/s/patternissue-fi8q7 Thanks so much for any advice or help.

Kristin
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Pattern Issue - won't switch back to colors

Hello khoff18,

Welcome to our forum and thanks for contacting us with your question!

Your initialDataArray is missing color settings. You've probably thought that they are not necessary since they aren't required in initial config, but that is not the case and once chart is updated and points' colors are changed you need to update them with new values if you want to get initial colors back.
Demo: https://codesandbox.io/s/patternissue-forked-blfpv

Let me know if that was what you were looking for!
Best regards!
Mateusz Bernacik
Highcharts Developer
khoff18
Posts: 2
Joined: Thu Oct 14, 2021 8:52 pm

Re: Pattern Issue - won't switch back to colors

You were spot on! I was trying to match the data array to what it looked like when the page loaded and now that the color is added everything works perfect. Thank so much for the help!
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Pattern Issue - won't switch back to colors

You're welcome! In case of any further questions, feel free to contact us again.
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”