Hi,
I’m experimenting with the LegendModifier and want to control which RenderableSeries are shown via the “LegendItemTemplate” approach. The idea is to add a specific tagging class to the RenderableSeries.DataSeries.Tag and use the content inside the LegendItemTemplate which I define in the Window.Resouces.
The tagging Class:
public class DataSeriesTag
{
public string LegendText { get; set; }
public bool ShowLegend { get; set; }
}
The LegendItemTemplate:
<Window.Resources>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<!--<CheckBox Width="16" Margin="5,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay}"
Visibility="{Binding RenderableSeries.DataSeries.Tag.ShowLegend, Converter={dxmvvm:BooleanToVisibilityConverter}}" />-->
<s:PointMarker Grid.Column="1" Margin="5,0,0,0" Width="40" Height="10" VerticalAlignment="Center" HorizontalAlignment="Center"
DataContext="{Binding RenderableSeries}"
DeferredContent="{Binding LegendMarkerTemplate}"
Visibility="{Binding ShowSeriesMarkers, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={dxmvvm:BooleanToVisibilityConverter}}" />
<TextBlock Margin="5,0,5,0"
Grid.Column="2"
HorizontalAlignment="Left"
Text="{Binding RenderableSeries.DataSeries.Tag.LegendText}" />
</Grid>
</DataTemplate>
</Window.Resources>
As long as I declare the SciChartSurface.ChartModifier in XAML, it works perfect.
The proplem raises when I bind the ModifierGroup to a ViewModel Property and try to build the LegendModifier there. How can I assign the LegendItemTemplate in the ViewModel?:
legendModifier = new LegendModifier(){
ShowLegend = true,
ShowVisibilityCheckboxes = false,
LegendItemTemplate = ??????
};
TheModifiers.ChildModifiers.Add(legendModifier);
Kind regards
Martin
- Martin Mohr asked 4 years ago
- last active 4 years ago
I am creating point data series using SCIXyScatterRenderableSeries.
I need to tap on specific data points and display pop over or some view on top of it. Pop over provides information regarding that point.
How can I implement that in iOS.
- Vikas Ahuja asked 5 years ago
- last active 4 years ago
On the vertical chart custom tooltipSvgTemplate seriesInfo isHit returns false always. Its working fine on the normal chart. Can you please check this issue is on verticle chart.
- Jerin Mathew asked 3 years ago
- last active 3 years ago