While following the telerik example of how to set the position of the x and x axis labels on a chart (link below) Visual Studio gives me an error "'position' does not exist in type 'ChartYAxisItemLabels'".
I checked the kendo.all.d.ts (version v2023.1.314) file that is referenced by my project and the interface is defined as follows:
interface ChartYAxisItemLabels {
background?: string | undefined;
border?: ChartYAxisItemLabelsBorder | undefined;
color?: string | undefined;
culture?: string | undefined;
dateFormats?: ChartYAxisItemLabelsDateFormats | undefined;
font?: string | undefined;
format?: string | undefined;
margin?: number | ChartYAxisItemLabelsMargin | undefined;
mirror?: boolean | undefined;
padding?: number | ChartYAxisItemLabelsPadding | undefined;
rotation?: number | ChartYAxisItemLabelsRotation | undefined;
skip?: number | undefined;
step?: number | undefined;
template?: string|Function | undefined;
visible?: boolean | undefined;
visual?: Function | undefined;
}
Adding the following line to the interface resolves the VS error and allows the TypeScript to compile and, when implemented, does move the axis labels to the "start" position just like in the telerik dojo example.
position?: string | undefined;
My question is; Why is the position setting not provided on the TypeScript interface to begin with?
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/xaxis.labels#xaxislabelsposition
Hi Bill,
The label position's TS definition was added 10 months ago. I am pasting the ChartYAxisItemLabels interface below:
interface ChartYAxisItemLabels { background?: string | undefined; border?: ChartYAxisItemLabelsBorder | undefined; color?: string | undefined; culture?: string | undefined; dateFormats?: ChartYAxisItemLabelsDateFormats | undefined; font?: string | undefined; format?: string | undefined; margin?: number | ChartYAxisItemLabelsMargin | undefined; mirror?: boolean | undefined; padding?: number | ChartYAxisItemLabelsPadding | undefined; position?: string | undefined; rotation?: number |ChartYAxisItemLabelsRotation | undefined; skip?: number | undefined; step?: number | undefined; template?: string|Function | undefined; visible?: boolean | undefined; visual?: Function | undefined; }
What is the error you are you are having? What Kendo UI version are you using?
Regards,
Nikolay
interface ChartXAxisItemLabels { background?: string | undefined; border?: ChartXAxisItemLabelsBorder | undefined; color?: string | undefined; culture?: string | undefined; dateFormats?: ChartXAxisItemLabelsDateFormats | undefined; font?: string | undefined; format?: string | undefined; margin?: number | ChartXAxisItemLabelsMargin | undefined; mirror?: boolean | undefined; padding?: number | ChartXAxisItemLabelsPadding | undefined; position?: string | undefined; //https://www.telerik.com/forums/issue-setting-chart-x-and-y-axis-position-in-typescript rotation?: string | number | ChartXAxisItemLabelsRotation | undefined; skip?: number | undefined; step?: number | undefined; template?: string|Function | undefined; visible?: boolean | undefined; visual?: Function | undefined; }
Hi Bill,
Thank you for pointing this out to me. I will update the kendo.all.d.ts file.
As a token of gratitude for reporting this, I have added some Telerik points to your account.
Regrads,
Nikolay