Declined
Last Updated: 20 Oct 2020 10:29 by ADMIN
yao
Created on: 16 Nov 2019 08:18
Category: KendoReact
Type: Feature Request
0
How to realize the custom sorting of x-axis of the react column chart

Hello

There was an error calling “ chart.surface.redraw() ” 

 

  onRender = (args,mapValues,stackedOrderBy) => {              
        const chart = args.target.chartInstance;      

        const valueAxis = chart.findAxisByName("valueAxis");
        const categoryAxis = chart.findAxisByName("categoryAxis");

        if (!chart) return;        

           let x= 1;
            if( stackedOrderBy!="Ascending")
                x=-1;

            let axis = categoryAxis.options;

            axis.categories = axis.categories.sort(function (a, b) {
                if (mapValues[a] < mapValues[b]) {
                return -1*x;
                }
                if (mapValues[a] > mapValues[b]) {
                return 1*x;
                }

                return 0;
            });


            chart.surface.redraw();

                           
1 comment
ADMIN
Stefan
Posted on: 19 Nov 2019 08:50

Hello,

It is expected, as the surface does not have a redraw method.

Please let us know if there is a place in the documentation where the redraw method is shown for the surface?

Also, this is marked as a feature request, but it looks like a support ticket.

I noticed that this account is not associated with a valid Trial or a license, please ask the license holder to assign a valid license for it.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items