The style property on XAxisProps.labels and YAxisProps.labels is typed as a { fontSize?: number | string; } and prevents us from stylizing the labels correctly
Current type in @highcharts/react:
// node_modules/@highcharts/react/options/XAxis.d.ts
labels?: {
...
style?: {
fontSize?: number | string;
};
...
}
Correct type from highcharts:
// node_modules/highcharts/highcharts.d.ts - XAxisLabelsOptions
style?: (CSSObject|XAxisLabelsStyleOptions);
The Highcharts API documentation indicates it could be a CSSObject (and uses it in the example)
The error:
When following the incorrect types and passing for example a color attribute in the styles:
Object literal may only specify known properties, and 'color' does not exist in type '{ fontSize?: string | number | undefined; }'.ts(2353)
Expected type:
style?: (CSSObject|XAxisLabelsStyleOptions);
Versions:
@highcharts/react: 4.2.1
highcharts: 12.5.0
The style property on
XAxisProps.labelsandYAxisProps.labelsis typed as a{ fontSize?: number | string; }and prevents us from stylizing the labels correctlyCurrent type in
@highcharts/react:Correct type from highcharts:
The Highcharts API documentation indicates it could be a CSSObject (and uses it in the example)
The error:
When following the incorrect types and passing for example a color attribute in the styles:
Object literal may only specify known properties, and 'color' does not exist in type '{ fontSize?: string | number | undefined; }'.ts(2353)Expected type:
Versions:
@highcharts/react: 4.2.1
highcharts: 12.5.0