add text to bottom of chart

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

    Posted 05 May 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
    267 posts
    Member since:
    Jul 2012

    Posted 07 May 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. Kendo UI is VS 2017 Ready
  4. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 09 May 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!
     
  5. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 09 May in reply to Daniel Link to this post

    thanks
Back to Top
Kendo UI is VS 2017 Ready