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

Rotate rectangle in visualTemplate

2 Answers 54 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Niels
Top achievements
Rank 1
Niels asked on 02 Jun 2015, 06:15 AM

Hi,

 I can't figure out how to rotate a rectangle in my visualTemplate. If I add a rectangle like this to the Group that contains the elements in the template, how do I rotate the rectangle?

var r = new kendo.dataviz.diagram.Rectangle({
    width: 60,
    height: 60,
    fill: 'white',
    stroke: { color: 'black', width: 2 }
});
g.append(r);

Thanks :-)

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 04 Jun 2015, 07:48 AM

Hello Niels,

You can use the rotate method on the Rectangle:

// Rotate around center
rect.rotate(45, new dataviz.diagram.Point(30, 30))

This is currently missing in the documentation. I'll update it to include this method.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Niels
Top achievements
Rank 1
answered on 09 Jun 2015, 10:47 AM
Great! Thanks :-)
Tags
Diagram
Asked by
Niels
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Niels
Top achievements
Rank 1
Share this question
or