I am trying to listen changes in pie chart segment selections. I am adding the listener like so:
piesegment.addChangeListener { changedSegment in
print("changed selection \(changedSegment.isSelected)")
}
The closure is never called however. My first question is: Is this the right way of doing this? In Android I implement the PieSegmentChangeListener interface and do an addIsSelectedChangeListener on the segment. In ios the SCIPieSegmentChangeListener is not a protocol. My second question is: How can I create a my own listener like in android and add it to the segment?
By the way support should not be exired!!!!
- Marcus Maringer asked 10 months ago
- last active 10 months ago
Hello,
My goal is to have the user select a series with a mouse click, and to see which series was selected while following the MVVM pattern. I am filling in the DataSeries using a LineSeriesSource attached behaviour.
What I tried so far is to attach to the SelectionChanged event of a Renderable series with an Interaction Trigger.
This doesn’t work:
<SciChart:SciChartSurface.ChartModifier>
<SciChart:ModifierGroup>
<SciChart:SeriesSelectionModifier >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged" >
<i:InvokeCommandAction Command="{Binding Path=cmdSelectedSeriesChanged}" CommandParameter="{Binding Path=SelectedSeries}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
<Style TargetType="SciChart:BaseRenderableSeries">
<Setter Property="Stroke" Value="White"/>
<Setter Property="StrokeThickness" Value="2"/>
</Style>
</SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
</SciChart:SeriesSelectionModifier>
</SciChart:ModifierGroup>
</SciChart:SciChartSurface.ChartModifier>
This works, but is not what I want since it’s not MVVM:
<SciChart:SciChartSurface.ChartModifier>
<SciChart:ModifierGroup>
<SciChart:SeriesSelectionModifier SelectionChanged="SeriesSelectionModifier_SelectionChanged">
<SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
<Style TargetType="SciChart:BaseRenderableSeries">
<Setter Property="Stroke" Value="White"/>
<Setter Property="StrokeThickness" Value="2"/>
</Style>
</SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
</SciChart:SeriesSelectionModifier>
</SciChart:ModifierGroup>
</SciChart:SciChartSurface.ChartModifier>
Interaction Propety cannot be attached to SciChartSurface.RenderableSeries.
I also tried attaching the Interaction Property to an individual DataSeries, which is definitely not what I want to do, but it doesn’t work either.
/Tomasz
- Tomasz Cholewinski asked 8 years ago
- last active 8 years ago