Is there a way to bind the size of a marker on a PointSeries to a XamNumericSlider control or similar control. I'd also like to bind the color of a LineSeries and PointSeries to a color picker control.
Hello dougsimpson,
I have been looking into your requirements and I created a small sample for you in order to demonstrate a sample approach to achieve this. In my sample I bound MarkerSize property of the points to the value of the slider as follows:
<igCA:Series.Marker>
<igCA:Marker MarkerSize="{Binding ElementName= slider, Path=Value}"/>
</igCA:Series.Marker>
also I handle the SelectedColorChanged event of the xamColorPicker to change the series color:
ScatterChart2D.Series[0].Fill = new SolidColorBrush(color.SelectedColor.Value);
For additional reference please check the attached sample.
If you need any further assistance on this feel free to ask.
Thanks for the reply, but a PointSeries does not have a MarkerSize property. So, should I bind the height and width of the MarkerStyle property to the slider's Value property? Or, is there a better way?
Changing the height and width does not work. Any ideas?
I modified my sample in order to use Point series and on my side the points still resize as expected using MarkerSize property.
Would you take a look at the attached sample which I have attached to this post.
If this still doesn’t suit your scenario please let me know.
The sample you posted still uses a Series and not a PointSeries. It also uses the soon-to-be obsolete XamChart versus the XamDataChart component.
Hello dougsimpson ,
Excuse me for the misunderstanding, I assumed that you use our XamChart because you have posted your question under XamChart section in the forum.
I modified my sample in order to represent the same functionality for our XamDataChart. In order to change the marker size I create the following style:
<ig:PointSeries.MarkerStyle> <Style TargetType="{x:Type ig:Marker}"> <Setter Property="Width" Value="{Binding ElementName= slider, Path=Value}"/> <Setter Property="Height" Value="{Binding ElementName= slider, Path=Value}"/> </Style> </ig:PointSeries.MarkerStyle>
Please let me know if you need any additional assistance with this matter or if I have misunderstood you in any way.
Oh. Apologies for posting to the wrong forum. This technique works. Thanks!