Hello.
I have a XYRenderableDataSeries with point markers with a fill color.
I also have a DataPointSelectionModifier which allows me to select clusters up to 5 from the series.
I want that when I select a cluster from the series, the points selected from the series should be colored for that specific cluster. i.e. all the cluster colors should be different. Also, when I select another cluster, the colors in the points selected from 1st cluster or other clusters should be preserved.
Here’s the XAML code :
<s:XyScatterRenderableSeries DataSeries="{Binding ScatterData}">
<s:XyScatterRenderableSeries.PointMarker>
<s:EllipsePointMarker Width="3" Height="3" Fill="#AAFFFFFF" Stroke="SteelBlue" StrokeThickness="2"/>
</s:XyScatterRenderableSeries.PointMarker>
<s:XyScatterRenderableSeries.SelectedPointMarker>
<s:EllipsePointMarker Fill="{Binding ClusterColor, Mode=TwoWay}"
Width="12"
Height="12" />
</s:XyScatterRenderableSeries.SelectedPointMarker>
</s:XyScatterRenderableSeries>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<s:DataPointSelectionModifier Name="PointMarkersSelectionModifier"
IsEnabled="{Binding IsManualClustering}"
SelectionChanged="PointMarkersSelectionModifier_SelectionChanged"
SelectionFill="#B1B5B2B2"
SelectionStroke="#009E9C9C" />
<s:MouseWheelZoomModifier IsEnabled="True" />
<s:RubberBandXyZoomModifier IsEnabled="False" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
I tried to find examples but could not find any. Please let me know if we can reach a solution to this in some way.
Thank you.
- Ammar Khan asked 1 year ago
-
Hi Ammar, you need to combine the PaletteProvider API with DataPointSelectionModifier in order to colour series. Take a look at the bottom part of this documentation page: https://www.scichart.com/documentation/win/current/DataPoint%20Selection.html
-
this solves the problem of what color to give when a point is selected. However, what I want to achieve is giving the cluster on which cluster is selected and preserving the colors of other previously selected clusters. I am having trouble combining the two. Could you give an example? Can we change IPointMetaData data?
-
Hello. I still do not have the solution. Could you reply to my last question?
- You must login to post comments
Hi Ammar,
Thanks for your reply.
The easiest way to achieve the described behavior would be creating a separate XyScatterRenderableSeries for each cluster.
Please let us know if this is suitable for your project.
With best regards,
Lex
SciChart Technical Support Engineer
- Lex answered 1 year ago
- You must login to post comments
I think that would not achieve the solution.
The problem is: We already have some data plotted on the chart. The user can select points from the chart and create clusters through it.
So we already have a series plotted.
How would creating separate series’ for clusters achieve this?
- Ammar Khan answered 1 year ago
- You must login to post comments
Hi Ammar,
Thanks for your reply.
I am sorry for the misunderstanding.
Having a separate Renderable Series for a cluster will allow you to set the selected PointMarker Style independently for each cluster.
Is this what you are looking for?
With best regards,
Lex
SciChart Technical Support Engineer
- Lex answered 12 months ago
- You must login to post comments
Please login first to submit.