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

add text to bottom of chart

3 Answers 239 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 05 May 2016, 09:46 PM

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?

3 Answers, 1 is accepted

Sort by
0
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 07 May 2016, 09:17 AM

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?

 

0
Daniel
Telerik team
answered on 09 May 2016, 08:39 AM
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!
 
0
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 09 May 2016, 01:04 PM
thanks
Tags
Charts
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Daniel
Telerik team
Share this question
or