Adding axis labels to dashboard line chart

I have created a chart to display network ping time. But I can’t add labels to x and y axises. How can I do it, ? Can I add labels with CSS? If yes pls point me to a good example.
Thank u so much. I love node-red and awesome developers/ community.

You can add axis labels by sending this to chart

msg.ui_control = {
    options: {
        scales: {
            yAxes: [{
                scaleLabel:{
                    display:true,
                    labelString:'y-axis title'
                }
            }],
            xAxes: [{
                scaleLabel: {
                    display: true,
                    labelString: 'x-axis title'
                }
            }]
        }
    }
}
delete msg.payload;
return msg;

Hi, hotNipi,
Thank u so much, I have tested. This my code. I have tried the code, but when I inject the data goes missing. Pls help.


flows.json (3.4 KB)
Pls

Oh yes, my bad. If to change scales and axes, it takes to have at least axis scale type for time series

msg.ui_control = {
    options: {
        scales: {
            yAxes: [{
                scaleLabel: {
                    display: true,
                    labelString: 'y-axis title'
                }
            }],
            xAxes: [{
                type: 'time',
                scaleLabel: {
                    display: true,
                    labelString: 'x-axis title'
                }
            }]
        }
    }
}
delete msg.payload;
return msg;

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