This is a migrated thread and some comments may be shown as answers.

What is the equivalent alternative method for kendoChart _toModelCoordinates(x,y)

1 Answer 106 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Mahesh
Top achievements
Rank 1
Mahesh asked on 21 Jun 2017, 06:12 AM

kendoChart _toModelCoordinates(x,y) method is missing in the kendo ui v2017.2.504.

We have used this method in the older kendo version v2015.3.1111

_toModelCoordinates:function(t,n){var i=this.element,r=i.offset(),o=parseInt(i.css("paddingLeft"),10),a=parseInt(i.css("paddingTop"),10),s=e(window);return new Xt(t-r.left-o+s.scrollLeft(),n-r.top-a+s.scrollTop())}

Please let us know what is the equivalent alternative method for it in the latest kendo-ui version v2017.2.504 as soon as possible

 

Thanks,

Mahesh

 

 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Jun 2017, 04:58 AM
Hello Mahesh,

The method has been moved to an internal instance:
chart._instance._toModelCoordinates
Note however that methods starting with underscore are considered internal and are not recommended to be used because they can be changed. All the method does is subtract the offset so I would suggest to use the approach from the snippet below instead of the internal method:
function surfaceCoordinates(element, x, y) {   
    var offset = element.offset();
 
    return {
        x: x - offset.left,
        y: y - offset.top
    };
}


Regards,
Daniel
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Charts
Asked by
Mahesh
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or