Rotate rectangle in visualTemplate

3 posts, 1 answers
  1. Niels
    Niels avatar
    13 posts
    Member since:
    May 2015

    Posted 02 Jun 2015 Link to this post

    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. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 04 Jun 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Niels
    Niels avatar
    13 posts
    Member since:
    May 2015

    Posted 09 Jun 2015 in reply to T. Tsonev Link to this post

    Great! Thanks :-)
Back to Top