Timeline
Basic
Timeline is element for displaying data in a chronological manner. These data can be static (set during design-time), or dynamic (set from your program code).
Timeline handles it's data in terms of events and periods. Events are described with single date (or value), and periods are
described by two dates(values) - the start and end for a period. Both events and periods are highly adjustable for display. There is a number
of properies for both entities that can customize their looks to suite your needs. Read more on these entities in TimelinePoints and TimelinePeriods.
Timeline can show it's data in two modes : using dates or using values (long values in C#). The key property that determines
mode is Timeline.UseDates.
When using date-based timeline, you are limited to the period of 1. AD - 9999. AD. This is imposed by .NET date representation limit.
Setting data programmaticly
Assume you have report containing Timeline with Name set to "timeline0". All you should do is set report XML file, then set timeline events and periods.
// C# code
Stampa.ReportDocument document = new Stampa.ReportDocument();
// set .xml file for printing
document.setXML("timeline.xml");
// create events for your timeline
TimelinePoint event1 = new TimeLinePoint();
event1.Text = "FIFA World Cup 2006";
event1.Date = new DateTime(2006, 6, 9);
TimelinePoint event2 = new TimeLinePoint();
event2.Text = "Olypic Games Italy";
event2.Date = new DateTime(2006, 2, 10);
// create periods for your timeline
TimelinePeriod period1 = new TimelinePeriod();
period1.Text = "FIFA World Cup 2006";
period1.StartDate = new DateTime(2006, 6, 9);
period1.EndDate = new DateTime(2006, 7, 9);
// add data to the timeline0
document.AddTimelineData("timeline0", new TimelinePoint[]{point1, point2}, new TimelinePeriod[]{period1} );
The length of data array (array of double values) should be the same as the number of Categories (in this case 3). If non-existant chart-name is used,
the data will be ignored. Pay attention that we'are adding series here ; if you display only dynamic data, don't set any static data during design-time.
XML structure
Sample XML structure for ChartBox :
<timeline name="timeline1" x="492" y="512" width="250" height="180" useDates="True" stripeNumber="1" stripeSize="20"
stripeStyle="Arrow" Layout="EveryPage" Selectable="True" horAlignment="None" verAlignment="None" >
<backgroundColor color="White" />
<stripeColor color="LightBlue" />
<startDate value="1/1/2006 12:00:00 AM" />
<endDate value="12/31/2006 12:00:00 AM" />
<startValue value="0" />
<endValue value="100" />
<markerStyle value="Grid" />
<markerPeriod value="Month" />
<markerColor color="Silver" />
<padding width="10" height="10" />
<border width="1" />
<pdfImageQuality value="80"/>
<timepoints>
<timepoint showDate="True">
<date value="6/9/2006 12:00:00 AM" />
<value value="0" />
<text value="FIFA World Cup" />
<box width="100" height="50" textColor="Black" color="White" boxShadow="True" />
<boxOffset x="0" y="20" />
<dateFormat value="dd/MM/yyyy" />
<pictureFile value="" />
<pictureSize width="80" height="100" />
<pictureOffset x="20" y="-20" />
<pictureBorder width="1" color="Black" />
<font family="Tahoma" size="8" underline="False" />
</timepoint>
...
</timepoints>
<timeperiods>
<timeperiod offset="-30" color="Navy" >
<startDate value="4/1/2006 12:00:00 AM" />
<endDate value="8/1/2006 12:00:00 AM" />
<startValue value="0" />
<endValue value="10" />
<text value="Period Description" />
<textPosition value="Top" />
<font family="Tahoma" size="8" underline="False" />
</timeperiod>
...
</timeperiods>
</timeline>
Timeline Properties
| BackgroundColor |
Back color of the timeline area. Default value : White |
| BorderWidth |
Border width of the timeline area (in pixels). If set to 0, border is not drawn. Default value : 1 |
| EndDate |
Timeline end date. This value is used when Timeline.UseDates property is set to true. Default value : 31.12.2006 |
| EndValue |
Timeline end value. This value is used when Timeline.UseDates property is set to false. Default value : 100 |
| Events |
Set of events that contain display data for timeline. Events are represented as instances of TimelinePoint class. |
| ExportQuality |
Display quality of element when exporting to PDF format (in percent). Lower quality produces smaller PDF files. |
| Height |
Timeline area rectangle height (in pixels). |
| HorizontalAlignment |
ChartBox alignment within page, relative to margins. Default value : None |
| Layout |
This property defines if element is displayed on every section page, first or last page only. Valid values are : EveryPage, FirstPage, LastPage. Default value : EveryPage |
| MarkerColor |
Color used for drawing markers - timeline divisions. Markers are drawn only if Timeline.UseDates is set to true. The marker type is set thru MarkerStyle property. Default value : Silver |
| MarkerPeriod |
The length of one marker segment. Markers are drawn only if Timeline.UseDates is set to true. Possible values are : Day, Week, Month, Year, Decade, Century. Default value : Month |
| MarkerStyle |
Marker display style. Markers are drawn only if Timeline.UseDates is set to true. Possible values are : None, Grid, Label. Default value : Grid |
| Name |
Timeline name used to identify the timeline within document when setting data programmaticly. Timeline objects should not have identical names within document. |
| Padding |
Inner padding of timeline element. Default value : 5,5 |
| Periods |
Set of periods that contain display data for timeline. Periods are represented as instances of TimelinePeriod class. |
Selectable |
This property defines whether object can be selected by left mouse click in design mode. Useful for locking background objects during design mode. If set to false, object can only be selected through Object Browser. Default value : true |
| StartDate |
Timeline start date. This value is used when Timeline.UseDates property is set to true. Default value : 1.1.2006 |
| StartValue |
Timeline start value. This value is used when Timeline.UseDates property is set to false. Default value : 0 |
| StripeColor |
Color used for drawing stripes (timeline segments). Default value : LightBlue |
| StripeNumber |
The number of timeline segments. Default value : 1 |
| StripeSize |
Stripe width (in pixels). Default value : 20 pixels |
| StripeStyle |
The type of stripe representation. Regular values are None, Line and Arrow. Default value : Arrow |
| UseDates |
When set to true, timeline uses dates for arranging display ; otherwise, it uses assotiated Values. If set to false, markers are not drawn. Default value : true |
| VerticalAlignment |
ChartBox vertical alignment within page, relative to margins. Default value : None |
| Width |
ChartBox width (in pixels). |
| X |
Left border coordinate (in pixels). |
XLabel |
The X-axis label. Default value : Categories |
| Y |
Top border coordinate (in pixels). |
|
TimelinePoints Properties
Events are defined by instances of TimelinePoint class. This class contains a number of properties for setting
appropriate event display.
| BoxColor |
Back color of the display box. Default value : White |
| BoxOffset |
Sets the position of display box relative to the stripe. Default value : 0, 20 |
| BoxShadow |
True if shadow is to be shown under display box. Default value : true |
| BoxSize |
The size of display box. Default value : 120, 60 |
| BoxTextColor |
Color for display box text. Default value : Black |
| Date |
Event date. This value is significant if TimeLine.UseDates is set to true. |
| DateFormat |
DateFormat for displaying event date.This value is significant if TimeLine.UseDates is set to true. Default value : dd/MM/yyyy |
| Font |
Display box font. Default value : Tahoma, 8 , Regular |
| Image |
Gets the bitmap image of report element. Useful for displaying image data within StyledTable |
| PictureBorderWidth |
The widht of picture border. Default value : 1 |
| PictureBorderColor |
Color for display picture border. Default value : Black |
| PictureFile |
The path of picture file relative to document root. Default value : String.Empty |
| PictureOffset |
Sets the position of picture display box relative to the stripe (in pixels). Default value : 20, -20 |
| PictureSize |
Sets the size of the picture (in pixels). Default value : 120, 80 |
| ShowDate |
If ShowDate is set to true, and Timeline.UseDates is set to true, the event description text is prepended with formatted event date. Default value : true |
| ShowPicture |
Determines whether event picture will be displayed. Default value : true |
| StretchPicture |
If StretchPicture is set to true, the picture is sized to fit PictureSize box ; otherwise, the picture is drawn in it's full size. Default value : true |
| Text |
Event description - display box text. if ShowDate is set to true, the text is prepended with formatted event date. Default value : Timeline Description |
| Value |
Event value. This value is significant if Timeline.UseDates is set to false. |
|
TimelinePeriods Properties
Periods are defined by instances of TimelinePeriods class. This class contains several properties for setting
appropriate period display.
| Color |
Display color for period stripe. Default value : Navy |
| EndDate |
Period end date. This value is used when Timeline.UseDates property is set to true. Default value : 1.8.2006 |
| EndValue |
Period end value. This value is used when Timeline.UseDates property is set to false. Default value : 10 |
| Font |
Display font for period description. Default value : Tahoma, 8, Regular |
| MarkSize |
The width of period stripe in pixels. Default value : 12 |
| Offset |
Period stripe offset relative to timeline stripe. Default value : -30 |
| StartDate |
Period start date. This value is used when Timeline.UseDates property is set to true. Default value : 1.4.2006 |
| StartValue |
Period start value. This value is used when Timeline.UseDates property is set to false. Default value : 0 |
Text |
The period description. Default value : Period Description |
| TextPosition |
The position of display text relative to the period stripe. Regular values are None (text is not displayed), Left, top, Right and Bottom. Default value : Top |
|
Copyright www.e-dynamica.com