My spline series has a primary axis of type TimeSpanAxis and a secondary axis of type NumericalAxis. How can I achieve segment dragging in both directions with limiting such that the Y axis dragging is limited to zero and a fixed maximum and X axis dragging would be limited to less than it's neighbors. For the first segment the X low limit would be TimeSpan zero and the last segments X high limit would be the axis max TimeSpan.
Currently I can only get segment dragging to work in the Y axis direction.
Any help would be greatly appreciated!
Thanks
Hi Jack,
We have analyzed your requirements and we would like to inform you that we don’t have x-direction dragging support for SplineSeries. So, we have achieved your requirement by extending SplineSeries and updated the data point based on mouse move.
And we have given input as seconds value and converted the data in x-axis LabelCreated event. Based on your requirement you can change the format in axis label created event.
Please check our workaround sample in below location and let us know if you have any questions.
Regards,
Moneeshram
Thank you for the example, I was able to adapt it for my needs.
Very much appreciated!
Hi Jack,
Thank you for the update. We are pleased to hear that the reported issue has been resolved. If you have any further questions, please do not hesitate to contact us. We are more than happy to assist.
Best regards,
Preethi R.
Hello again,
There is an issue I can't seem to figure out: Thou the drag editing now works in both axis, the drag tooltip can't display the X axis. I created a data template for the tool tip as :
<DataTemplate x:Key="dragTooltipTemplate">
<Border CornerRadius="4" BorderBrush="#FFF5F59A"
BorderThickness="1" Background="Yellow"
Margin="0,0,0,15">
<StackPanel>
<TextBlock FontSize="12" Text="{Binding NewValue, StringFormat='N1'}"
Width="35" Foreground="Black" Margin="2">
</TextBlock>
<TextBlock FontSize="12" Text="{Binding NewXValue}"
Width="35" Foreground="Black" Margin="2">
</TextBlock>
</StackPanel>
</Border>
</DataTemplate>
and applied it to the series DragTooltipTemplate property as a StaticResource binding
the template is applied at run time and no binding errors are shown, so the NewXValue is always zero?
Any ideas
We have validated your query and would like to inform you
that the X-directional dragging support is not available for the spline series,
and therefore the NewXValue is null. However, you can get the X and Y values
from the Segment.Item property in the data template binding, as shown in the
code snippet below.
<DataTemplate x:Key="template"> <Border CornerRadius="4" BorderBrush="#FFF5F59A" BorderThickness="1" Background="Yellow" Margin="0,0,0,15"> <StackPanel> <TextBlock FontSize="12" Text="{Binding Segment.Item.Year2014, StringFormat='N1'}" Width="35" Foreground="Black" Margin="2"> </TextBlock> <TextBlock FontSize="12" Text="{Binding Segment.Item.XTimeSpan}" Width="35" Foreground="Black" Margin="2"> </TextBlock> </StackPanel> </Border> </DataTemplate> |
Please check this solution and let us know if you need any further assistance.
Regards,
Moneeshram.