Is there way to add data trigger to XamChart, when value = 0, marker will become invisible or use transparent fill. Label will still be displayed.
Thanks!
----------------------------------------------------------------------------------------------------------------
<Style x:Key="NoLabelMarker" TargetType="{x:Type igCA:Marker}"> <Setter Property="Fill" Value="Black"/> <Setter Property="Stroke" Value="Black"/> <Setter Property="MarkerSize" Value=".5"/> <Setter Property="Foreground" Value="Transparent"/> </Style>
<igCA:XamChart Name="ColumnChart2D" Style="{StaticResource XamChartStyle}" Grid.Row="1" > <igCA:XamChart.Legend> <igCA:Legend Visible="False"/> </igCA:XamChart.Legend>
<!-- Data points --> <igCA:XamChart.Series>
<igCA:Series Label="Goal" x:Name="goalSeries" ChartType="line" StrokeThickness="0" Fill="#FFD70005"> <igCA:Series.DataPoints> <igCA:DataPoint Value="0" Label="A1"/> <igCA:DataPoint Value="0.8" Label="A2"/> <igCA:DataPoint Value="0.85" Label="A3"/> <igCA:DataPoint Value="0.95" Label="A4"/> <igCA:DataPoint Value="1.0" Label="A5"/> </igCA:Series.DataPoints> <igCA:Series.Marker> <igCA:Marker Style="{StaticResource NoLabelMarker}"/> </igCA:Series.Marker></igCA:Series>
</igCA:XamChart>
Hello,
Thank you for your post. I have been looking into it and the code you have provided and I created a sample project with the functionality you want, but the visibility of the Markers is set only when the Data is loaded after that if you change the DataPoint’s Values, the marker won’t appear or disappear, because I handled its loaded event since I believe the thing you want to achieve cannot be done by a Trigger. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
It worked! Thank you very much!
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I need to make line chart marker invisible when datapoint is 0.
THe data template and Loaded Event is not working for line chart. Will you modify your MLoad EventHandler to make line chart works? Thanks!
You can add the following line series to your sample project.
<igCA:Series Label="Goal" x:Name="goalSeries1" ChartType="line" StrokeThickness="0" Fill="#FFD70005"> <igCA:Series.DataPoints> <igCA:DataPoint Value="0.0" Label="A1" /> <igCA:DataPoint Value="0.5" Label="A2"/> <igCA:DataPoint Value="0.8" Label="A3"/> <igCA:DataPoint Value="0.7" Label="A4"/> <igCA:DataPoint Value="0.9" Label="A5"/> </igCA:Series.DataPoints> <igCA:Series.Marker> <igCA:Marker UseDataTemplate="True" DataTemplate="{StaticResource dt}"/> </igCA:Series.Marker> <igCA:Series.Animation> <igCA:Animation BeginTime="00:00:0.75" Duration="00:00:02"/> </igCA:Series.Animation> </igCA:Series>
Hello Lily,
I have used your code and modified the sample I sent you before, so now it works as you want. Please let me know you need further assistance on this matter.
This is great. Thanks!
Can you make the line chart not show the value of datapoint, only display the red dot?
Once again, thank you very much for your help.
-LIly
I am glad I helped you. As for the Marker’s Value you can set the Marker’s Format Property to “ “ (empty space) in order to achieve your goal. Please let me know if this helps you or you need further assistance on this matter.
Thanks a lot!! it works!
You should set it to "DontPlot" in order not to plot the null datapoints.
Thanks a lot for the hint. I am using the xamDataChart for the line series. I can see the property you mentioned for the series. Can you also tell me what is that I need to set the property to inorder to have the line series end at the point prior to it and start again at the point next to it.
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I created a sample project for you with the functionality you want. Basically I used XamDataChart instead of XamChart, where the thing you want is built in and you can chose how the Chart will treat the null values by setting Series’ UnknownValuePlotting Property.
Feel free to write me if you have further questions.
Is there a way to plot an empty point in the line series. By empty point, I mean the line joining the points should have a break at a data point if there is no value for that.