-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Hi,
I'm trying to style a linear scale (just fontStyle and fontColor) of a LineChart:
LinearTicks ticks = new LinearTicks().setFontStyle(FontStyle.BOLD);
LinearScale axis = new LinearScale().setTicks(ticks);
LinearScales scales = new LinearScales().addxAxis(axis)
LineOptions options = new LineOptions().setScales(scales);The problem is that the LinearScale always puts the property type: "linear" into the the tick config, and chartjs then wants me to configure all the other stuff for the ticks/scale and no data is displayed if not.
If I remove the the property from the chart JSON config object before initializing the Chart with delete json.options.scales.xAxes[0].type it's formating as expected.
Workaround for me was creating a class TypelessLinearScale extends LinearScale with @JsonIgnore on an overriden getType().
Not sure how to handle this problem "nicely", a type-less Scale would be nice, but setOptions(...) on LineOptions needs a LinearScale and not a Scale<?> or something.