Unplanned
Last Updated: 27 Jun 2018 17:27 by ADMIN
ADMIN
Martin Ivanov
Created on: 21 May 2018 10:18
Category: TimeLine
Type: Feature Request
2
Timeline: Implement ConvertDateTimeToPoint method
This could be implemented also in the RadTimeBar control.

Here is a sample implementation of the new method:

private Point ConvertDateTimeToPoint(DateTime dateTime, RadTimeBar timeBar)
{
    var periodStart = timeBar.VisiblePeriodStart;
    var periodEnd = timeBar.VisiblePeriodEnd;
    TimeSpan period = periodEnd - periodStart;


    var visibleTimeArea = this.timeBar.ActualWidth;
    var ticks = (dateTime - periodStart).Ticks;


    var pixelsPerTick = visibleTimeArea / period.Ticks;
    var x = ticks * pixelsPerTick;


    return new Point(x, 0);
}   
2 comments
ADMIN
Martin
Posted on: 27 Jun 2018 17:27
Hello Paul,
 
Thank you for sharing your thoughts. It is good to hear that you like the idea.

Regards,
Martin Ivanov
Paul Reynolds
Posted on: 21 May 2018 23:12
This is a great idea to ensure that the visible size does not drop below a minimum when using various zoom levels on data that may span a year along with single days...