How can I change the legends of a chart?<br /> I know how to change the font color of chart title and the chart axes but not the chart legend.
I don't use charts, but it appears you scroll down through the Options panel to the Chart Dataset settings and that is where you can change the name of the Legend.
Yeah but I need to change the legend font color and that is not possible.
The Chart component appears to be something that the devs created using the HTML Canvas feature, which uses javascript to generate the graphics and text. They seem to have allowed options to adjust the colors of all the text items except, unfortunately, the Legend. This may have been an oversight, or they may have just thought nobody would need to change the color.
Either way, it appears there's no way to do it through the BSS user interface. I'm not familiar enough with Canvas or javascript to know whether it's possible to write a custom script to override the Legend's color. I would imagine it should be possible as long as the Chart has a unique ID. Maybe some javascript expert here can chime in.
Meanwhile, I'd probably make a post in the Ideas forum suggesting that the devs add an option to change the Legend color, as they've made options to change all the other text colors on the Chart component.
Stuff like this is often implemented due to suggestions from users.
You change the color with with javascript. If you have more than one chart on the page give each chart an ID. If you have only one chart and no ID on the page you can change the line in the script let chart = document.querySelector('#your-id canvas').chart; to let chart = document.querySelector('canvas').chart;
You can try this script
$(document).ready(function() {
let chart = document.querySelector('#your-id canvas').chart;
chart.options.legend = {
display: true,
labels: {
fontColor: 'rgb(255, 99, 132)',
fontSize: 28
}
}
chart.update();
});
you can read more about the ledgends here
Maybe some javascript expert here can chime in.
(POOF) @kuligaposten appears lololol
lol