I am using SfChart to display a HiLoOpenCloseSeries to display data points. This works as expected as it shows all the proper datapoint markers on the chart the first time. When I subsequently create a new SfChart that renders another HiLoOpenCloseSeries, the datapoint markets for both charts do not exist anymore. The data is correct but every data point is not visible. What could be the possible causes of this and how should I go about to troubleshoot this?
Hi Eric,
We have created a simple sample with HiLoOpenCloseSeries displaying data markers at load time and dynamically added another chart, but we were unable to do so. Perhaps we misunderstood your scenario. Could you please clarify your requirements with more details or provide an example? If possible, could you modify your case in the provided sample? This will help us to give better follow-up and provide an effective solution.
Regards,
Nitheeshkumar.
Hi Nitheeshkumar,
I want to set the AdornmentsInfo property to the HiLoOpenCloseSeries with a xaml style that allows the chart to show the respective labels. When I apply the style to a chart with HiLoOpenCloseSeries, this will properly show the labels. When I dynamically add another HiOpenCloseSeries chart and the style is applied to that chart however, it does not show the labels anymore. If I apply the style manually in C# this will work as expected but I want to do this through defining a Style in xaml instead.
<Setter Property="AdornmentsInfo" >
<Setter.Value>
<syncfusion:ChartAdornmentInfo AdornmentsPosition="TopAndBottom" ShowLabel="True" BorderThickness="0" Foreground="{DynamicResource primary_foreground}"
Background="Transparent" SegmentLabelContent="YValue" SegmentLabelFormat="{Binding Path=numeric_format, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Setter.Value>
</Setter>
Hi Macro,
We would like to inform you that we tested the provided code in a simple sample and found that the same instance of the style is not applicable across multiple charts, resulting in the markers not being visible. By setting x:Shared="False" in the style, it generates a unique instance for different charts, which meets your requirement. Please try this solution and let us know if you have any concerns. We have attached a code snippet and an image for your reference.
<Window.Resources> <Style TargetType="chart:HiLoOpenCloseSeries" x:Key="markerStyle" x:Shared="False"> <Setter Property="AdornmentsInfo"> <Setter.Value> <chart:ChartAdornmentInfo ShowMarker="True" SymbolInterior="Black" Symbol="Diamond"/> </Setter.Value> </Setter> </Style> </Window.Resources> |
Regards,
Nitheeshkumar.