add text to bottom of chart

4 posts, 0 answers
  1. Morten
    Morten avatar
    304 posts
    Member since:
    Jul 2012

    Posted 05 May 2016 Link to this post

    On a page I have several charts and a button to export all charts to png.

    Is it possible to "stamp" the current date into either the charts or the produced png file?

  2. Morten
    Morten avatar
    304 posts
    Member since:
    Jul 2012

    Posted 07 May 2016 Link to this post

    from this http://docs.telerik.com/kendo-ui/controls/charts/how-to/donut-chart-hole-text I was able to draw current datetime on the chart this way:

    render: function (e) {
      var draw = kendo.drawing;
      var d = new Date();
      var text = new draw.Text(kendo.toString(d, 'dd-MMM-yyyy HH:mm'), [0, 0], { font: "8px Verdana,Arial,sans-serif" });
      e.sender.surface.draw(text);
     
    }

    How do I position the datetime at position bottom/right with a little margin?

     

  3. Daniel
    Admin
    Daniel avatar
    2177 posts

    Posted 09 May 2016 Link to this post

    Hello,

    You could use the drawing align and vAlign methods to position the text - example.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  4. Morten
    Morten avatar
    304 posts
    Member since:
    Jul 2012

    Posted 09 May 2016 in reply to Daniel Link to this post

    thanks
Back to Top