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

Graph - Are Plot Bands possible

1 Answer 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 30 Nov 2013, 03:09 PM
Hi There,

As per title: I have created a Gantt using the new "Graph"  (image attached) and need some way of indicating the current date, either using a vertical line or a coloured area. Is this possible with graph?

Thanks
Si.

1 Answer, 1 is accepted

Sort by
0
Ivan Hristov
Telerik team
answered on 04 Dec 2013, 02:49 PM
Hello Simon,

You have two ways to accomplish this:
  1. The simplest approach is to add an another area series which will use the already created coordinate system and set its X to =Date.Now(), Y0 to the minimum and Y to the maximum of your Y axis.
  2. The slightly more complicated approach is to create a second coordinate system which will use the already created X axis. Its Y axis will be used to mark the current date. To change its placement you need to have two CrossAxisPositions to the X axis. The first one will be used as a standard Y axis with Position = Auto. You have to set the second one programmatically in order to set its value to the current date.
        You can use the following code snippet as an example:
var scale = this.dateTimeAxis.Scale as DateTimeScale;
var crossAxisPosition = new DateTimeScaleCrossAxisPosition()
{
    Position = GraphScaleCrossAxisPosition.Specific,
    Value = DateTime.Now.AddDays(3).Date
};
scale.CrossAxisPositions.Add(crossAxisPosition)

Hope it helps.

Regards,
Ivan Hristov
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Share this question
or