HelloJunaydIqbal
Posts: 7
Joined: Sun Oct 16, 2022 12:41 pm
Contact: Website

When reset zoom button the colors on my line will revert back to legend color

Hello,
I'm facing issue when the chart will zoom with the zoomType "x" or "xy" so the colors revert back to legend same colors. The chart type is "line"
The code of series is here:

Code: Select all

{
      type: 'line',
      name: 'Price',
      colorKey: 'z',
      data: makeCoordinates(options.data[2].x, options.data[2].y, false, options.data[2].days_until_halving),
      showInLegend: true,
      lineWidth: 0,
      color: "#eb4444",
      colorAxis: 0,
      marker: {
        enabled: true,
        radius: 3.5,
        symbol: 'circle'
      }
}
makeCoordinates method to makes the coordinates this is fine and not issue with this because I already work on others graphs with same method but issue only on to revert back the colors when reset zoom button on highstocks.

The code in stockChart(id, {

chart: {
height: 650,
zoomType: 'x',
backgroundColor: 'transparent'
}
}

But if I changed the zoomType to "y" only then it works fine only issue on "x".

You can see on the attached .gif image.
Image
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: When reset zoom button the colors on my line will revert back to legend color

Hello,

I was trying to reproduce your problem, but in my case everything is working correctly: https://jsfiddle.net/BlackLabel/rf2aom06/

Could you reproduce the issue in an online editor that I could work on? Because I don't know how you use coloraxis.

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
HelloJunaydIqbal
Posts: 7
Joined: Sun Oct 16, 2022 12:41 pm
Contact: Website

Re: When reset zoom button the colors on my line will revert back to legend color

I'm using stockChart() not only chart(), but if I used chart() only the working is fine on my side, if I used stockChart(), this will show the same issue as you can see on .gif. Because I used stockChart() due to range bar on bottom side so there is no issue on chart(). And I used the colorKey to show these colors on line. So colorKey not work when reset zoom button click all the colors showed bydefault color (legend icon color). So this is the major issue.
HelloJunaydIqbal
Posts: 7
Joined: Sun Oct 16, 2022 12:41 pm
Contact: Website

Re: When reset zoom button the colors on my line will revert back to legend color

Part(2/2) of this comment: viewtopic.php?f=12&t=49776&p=181539#p181539

I've attached the fiddle link for you to add some dummy data on it to draw the same line, scroll down you can check the code part and let me know what issue is on after zoom out

Demo: https://jsfiddle.net/wz9sn31b/2/
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: When reset zoom button the colors on my line will revert back to legend color

Hi,

I tested this demo by modifying the data, changing the chart settings in different ways and it is not a configuration problem on your side but rather some bug.

I recommend that you report it on GitHub, there you should get more information and a potential workaround if possible until the bug is fixed: https://github.com/highcharts/highchart ... new/choose

If you have any further questions, feel free to contact us!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”