Change color of chart legend/axis and grid (Legacy Dashboard)

Hello,

I want to change the color of the chart labels on x/y axis (in my case from black to white) as well as the grid lines.

It might be possible through passing in a config json object, however I haven't found any documentation for that. I have found that post where it seems that a msg.ui_control is set to a complete chart config json.

Has anybody I minimal example of how to change at least the color of the labels on the x/y axis? Changing the grid line color is useful as well.

Setting up the config via json through ui_control worked!

msg.ui_control = { 
    options: {
        scales: {
            xAxes: [{                
                gridLines: {
                    display: true,
                    color:'transparent',
                    zeroLineColor: 'white'
                },
                type: 'time',
                ticks: {
                    fontColor: 'white'
                }
            }],
            yAxes: [{
                gridLines:{
                    display: true,
                    color:'transparent',
                    zeroLineColor: 'white'
                },
                ticks: {
                    fontColor:'white'
                }
            }]
        }
    }
}
return msg; 

image

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.