Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

[Bug]: Dygraph charts not changing colours when "data-colors" amended. #463

Open
loveaj opened this issue Mar 22, 2023 · 5 comments
Open
Labels
bug Something isn't working needs triage

Comments

@loveaj
Copy link

loveaj commented Mar 22, 2023

Bug description

I'm using netedata charts in React JSX components.

When I change the "data-colors" parameter of the chart to custimise the colours, nothing changes in the displayed chart. Inspecting the HTML of the displayed page shows the amended parameter, it's just not being used. See screenshot.

The colour values specified are blue and green. The graph shows pink and yellow.

Expected behavior

Changing the "data-colors" parameter and deploying another build should show the new chart colours.

Steps to reproduce

  1. Embed a netdata chart in a React JSX component and customise the colours using the "data-colors" parameter.
  2. Deploy and view the page. The original colours will be displayed.
  3. Change the colours in the "data-colors" parameter and rebuild the React app.
  4. Deploy and view the page. The original colours will be displayed not the new ones.

Screenshots

Screenshot from 2023-03-22 12-43-33

Error Logs

No response

Desktop

OS: Linux, MacOS, Windows
Browser Chrome, Edge
Browser Version Chrome version 111.0.5563.64 (Official Build) (64-bit)

Additional context

No response

@loveaj loveaj added bug Something isn't working needs triage labels Mar 22, 2023
@hugovalente-pm
Copy link
Contributor

@novykh is this something specific to the netdata/dashboard repo or generic to charts?

@ktsaou
Copy link
Member

ktsaou commented Mar 22, 2023

@loveaj it works like this:

<div data-netdata="apps.cpu"
             data-width="100%"
             data-height="300px"
             data-after="-60"
             data-points="60"
             data-debug="false"
             data-decimal-digits="0"
             data-dt-element-name="time903"
             data-colors="#000000 #111111 #222222 #333333 #444444"
        ></div>

Result:

image

Without data-colors is like this:

image

The dashboard appends also the normal pallet to your colors, so that if the chart needs more colors, it will have them.

@hugovalente-pm hugovalente-pm transferred this issue from netdata/netdata-cloud Mar 22, 2023
@loveaj
Copy link
Author

loveaj commented Mar 22, 2023

@ktsaou That is exactly what I am doing. In your example I initially code the chart as:

<div data-netdata="apps.cpu" data-width="100%" data-height="300px" data-after="-60" data-points="60" data-debug="false" data-decimal-digits="0" data-dt-element-name="time903" data-colors="#000000 #111111 #222222 #333333 #444444" ></div>

   Then at some point I decide I want a different colour palette and so I change the code to:

   `<div data-netdata="apps.cpu"
         data-width="100%"
         data-height="300px"
         data-after="-60"
         data-points="60"
         data-debug="false"
         data-decimal-digits="0"
         data-dt-element-name="time903"
         data-colors="#555555 #666666 #777777 #888888 #999999"
    ></div>`

But when I display the chart the colours remain just as they did before.

@loveaj
Copy link
Author

loveaj commented Mar 22, 2023

It's only seems to be a problem with the dygraph chart type.
The google chart type works ok but I can't use that because it makes a call out to an external google api which is blocked by our firewall.

@loveaj
Copy link
Author

loveaj commented Mar 30, 2023

Is anyone able to reproduce this behaviour and investigate?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants