Issue setting chart x and Y axis position in TypeScript

1 Answer 189 Views
Charts General Discussions
Pete
Top achievements
Rank 1
Pete asked on 11 Apr 2023, 06:26 PM | edited on 12 Apr 2023, 04:10 PM

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

Bill
Top achievements
Rank 1
commented on 25 Oct 2024, 08:35 PM

Still an issue in version 2024.3.1015 - 1.5 years later...
Nikolay
Telerik team
commented on 30 Oct 2024, 11:05 AM

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

Bill
Top achievements
Rank 1
commented on 30 Oct 2024, 02:19 PM

Version 2024.3.1015. Its for the ChartXAxisItemLabels. The Y was fixed, but X is still an issue.

    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;
    }

Nikolay
Telerik team
commented on 04 Nov 2024, 09:41 AM

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

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 14 Apr 2023, 10:27 AM

Hello Pete,

Thank you for the provided report!

I'll make a note that we must update the TypeScript definitions to include the labels' position. I've added some Telerik Points to your account as a sign of gratitude for the information.

Please accept my apologies for the caused inconvenience.

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Charts General Discussions
Asked by
Pete
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or