Closed Puharesource closed 4 years ago
Hi, labels are part of the legend object not the options object aren't they?
options > legend > labels
https://www.chartjs.org/docs/latest/configuration/legend.html
For the generateLabels property just set the string value to whatever you function is, this is then rendered without the standard string double quotes by the decoration [JsonConverter(typeof(PlainJsonStringConverter))]
.
This maybe isn't obvious in the documentation so I'll update it to make it more explicit.
Oh yeah, I just forgot to put in the legend object, I've edited my original issue. Thank you, I'll try it out
EDIT: Worked perfectly
I'm attempting to change the labels in the legend, so that they show the value next to them. Using regular ChartJS, I'd have to pass a function to generateLabels in
In ChartJSCore I can only parse a string to
GenerateLabels
within theLegendLabel
class. It seems quite unclear how I'd achieve my goal. Clarification would be much appreciated, thank you.