Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2085
Stack EventSpans by Series
posted

I have a similar need as described in this post:

   https://ko.infragistics.com/community/forums/t/49045.aspx


However, I need to display multiple series of EventSpans/Points where each series is stacked.  Using the code from the above post and modifying it to use a negative EventSpan control template margin (as I want series to be stacked above the Axis), the stacked series are clipped from the control (I added a grid splitter control to try and dynamically expand the control in a grid, but that does not allow the control to resize and draw all the stacked series either).  I need to do this for an arbitrary number of series, and I know I have to calculate margins for the control templates based on the (assuming this capability has not been added as an option since the post above), but how can I expand the area the EventSpans can be drawn in?


<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="2">

<Grid.RowDefinitions>

<RowDefinition Height="*" />

</Grid.RowDefinitions>

<Grid.Resources>

<Style x:Key="ZoombarStyle" TargetType="{x:Type ig:XamZoombar}">

<Setter Property="Visibility" Value="Collapsed"/>

</Style>

<Style x:Key="EventSpan1Style" TargetType="ig:EventSpan">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="ig:EventSpan">

<Grid Margin="0,2,0,2">

<Rectangle Margin="0,0,0,0" 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">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="ig:EventSpan">

<Grid Margin="0,2,0,2">

<Rectangle Margin="0,-8,0,0" RadiusX="5" RadiusY="5" Fill="{ TemplateBinding Fill}" Stroke="{ TemplateBinding Stroke}" StrokeThickness="1" Height="10" VerticalAlignment="Top" />

</Grid>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

</Grid.Resources>

<ig:XamTimeline x:Name="xamTimeline" ZoombarStyle="{StaticResource ZoombarStyle}">

<ig:XamTimeline.Series>

<ig:DateTimeSeries Title="Series 1"

EventSpanStyle="{StaticResource EventSpan1Style}">

<ig:DateTimeSeries.Entries>

<ig:DateTimeEntry Time="07:00 01/01/2000" Duration="3:00" />

<ig:DateTimeEntry 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:DateTimeSeries.Entries>

<ig:DateTimeEntry Time="09:00 01/01/2000" Duration="2:00" />

<ig:DateTimeEntry Time="14:00 01/01/2000" Duration="1:00" />

</ig:DateTimeSeries.Entries>

</ig:DateTimeSeries>

</ig:XamTimeline.Series>

</ig:XamTimeline>

</Grid>

Parents Reply
  • 34810
    Offline posted in reply to Gary Wrinn

    Hello Gary,

    Thank you for your input on this matter.

    I am rather surprised that the http://schemas.infragistics.com/xaml namespace is reproducing this issue on your end, although it does essentially "wrap" the Infragistics.Controls.Timelines namespace mentioned in a previous update, and so perhaps that is why the error is occurring there as well.

    It does not entirely surprise me that the error does not happen when the XamTimeline is removed, since at that point, it doesn't appear that you are using the Infragistics namespace, and so Visual Studio will not try to access it when compiling. This still doesn't really explain why the issue is actually happening with the XamTimeline, though. Does this issue happen for you when using other Infragistics controls in your project, or just the XamTimeline, specifically?

    It is also possible that this could be a defect in the 15.1 version, specifically. Would it be possible for you to please provide the specific version of Infragistics for WPF 2015.1 that you are using? This number would look like 15.1.20151.XXXX.

    I can't help but feel like this could have to do with the "Mont.Utilities.Utilities.UI.Infragistics" namespace that you had mentioned in a previous update, as I feel like Visual Studio might be searching for a "Controls" child namespace to that one, and it may think that you are trying to reference Mont.Utilities.Utilities.UI.Infragistics.Controls.Timelines in this case. I am unsure why exactly Visual Studio would try to do this, and in creating a sample project with a namespace ending with "Infragistics," I was unable to reproduce the behavior you are seeing.

    Do you perhaps have an isolated sample project that I could run on my end that reproduces this behavior? If so, I would gladly take a look and try to assist you further.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Children
No Data