Closed a335967 closed 3 years ago
Hi, this isn't possible using the PluginDynamic attribute, this essentially just writes out the key/value pairs as properties.
You'd probably be better off creating you your own implementation of the Options class and using that rather than the provided one. Something like.
public class DataLabelsOptions : Options
{
public DataLabels DataLabels { get; set; }
}
public class DataLabels
{
public string Color { get; set; }
// Other datalabel properties here...
}
This may be similar to #59. Is there a way to specify that certain elements are to be rendered as plain Json instead of strings within the PluginDynamic object?
Specifically, I'm using the chartjs-plugin-datalabels plugin for labels and need to use a function in the formatter:
Any help you could provide is greatly appreciated!