Hello,
I need a compact overview of the timeline, without titles. I would like to be able to stack the event spans, so that they never overlap, but stack just like the titles do by default.
I think the poster here has the same question: http://blogs.infragistics.com/forums/t/23773.aspx but the answer provided is for the Silverlight timeline...
The Timeline still doesn’t have this functionality, but you can use the sample from the SL Timeline. Just change the resource names “x:Name” to “x:Key”.
<Style x:Name="EventSpan1Style"
to:
<Style x:Key="EventSpan1Style"
Thank you. I still did not get it to work though, as both the "SeriesPane" and "GridArea" types were not found... Are they Silverlight specific?
Sorry, I didn’t see that this sample uses some old API elements. Try using this code:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ig="http://schemas.infragistics.com/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.Resources>
<LinearGradientBrush x:Key="BaseBorderBrush" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFa3aeb9" Offset="0"/>
<GradientStop Color="#FF8399a9" Offset="0.3700000047683716"/>
<GradientStop Color="#FF718597" Offset="0.3709999918937683"/>
<GradientStop Color="#FF617584" Offset="1"/>
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<Style x:Key="EventSpan1Style" TargetType="ig:EventSpan">
<Setter Property="Stroke" Value="{StaticResource BaseBorderBrush}"/>
<Setter Property="Fill" Value="{StaticResource BaseBorderBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ig:EventSpan">
<Grid Margin="0,2,0,2">
<Rectangle RadiusX="5"
RadiusY="5"
Fill="{TemplateBinding Fill}"
Stroke="{TemplateBinding Stroke}"
StrokeThickness="1"
Height="10"
VerticalAlignment="Top" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="EventSpan2Style" TargetType="ig:EventSpan">
Margin="0, 11, 0, 0"
</Grid.Resources>
<ig:XamTimeline x:Name="Timeline">
<ig:XamTimeline.Series>
<ig:DateTimeSeries Title="Series 1"
EventSpanStyle="{StaticResource EventSpan1Style}">
<ig:DateTimeSeries.Entries>
<ig:DateTimeEntry Title="Series1 Entry 1" Time="07:00 01/01/2000" Duration="3:00" />
<ig:DateTimeEntry Title="Series1 Entry 2" Time="12:00 01/01/2000" Duration="2:00" />
</ig:DateTimeSeries.Entries>
</ig:DateTimeSeries>
<ig:DateTimeSeries Title="Series 2" Fill="Red"
EventSpanStyle="{StaticResource EventSpan2Style}">
<ig:DateTimeEntry Title="Series2 Entry 1" Time="09:00 01/01/2000" Duration="2:00" />
<ig:DateTimeEntry Title="Series1 Entry 1" Time="14:00 01/01/2000" Duration="1:00" />
</ig:XamTimeline.Series>
</ig:XamTimeline>
</Window>
Thanks again for the very fast reply!
This works, but is not exactly what I had in mind.
I'm sorry if my explanation was confusing, but what I really need is the following:
So stacking every span in a single DateTimeSeries, just like the titles do.
In this case you need to go through all events, find the spans that are intersect and split the intersected events in different series.