Hi Komatora,
Greetings from Syncfusion.
We have analyzed your query and we have achieved your requirement ”Update color each segment Candle series” by inherit the candle series and update the color for each segment. Please refer the below code snippet.
And for improving the performance only we used FastCandleBitmapSeries and we can’t customize it. Hence, we have achieved used your requirement by using Candle series.
[Code Snippet]
[C#]
public class CustomCandleSeries : CandleSeries
{
public List<SolidColorBrush> SegmentColors { get; set; }
public override void CreateSegments()
{
base.CreateSegments();
for(int i = 0; i<Segments.Count;i++)
{
var segment = Segments[i];
var canvas = segment.GetRenderedVisual() as Canvas;
if (canvas is null) return; // before ready
(canvas.Children[0] as Rectangle).Fill = SegmentColors[i];
}
}
} |
[Xaml]
<local:CustomCandleSeries x:Name="customCandleSeries"
High="High" Low="Low" Open="Open" Close="Close"
XBindingPath="XValue"
ItemsSource="{Binding Data}" >
</local:CustomCandleSeries> |
[C#]
customCandleSeries.SegmentColors = (this.DataContext as ViewModel).SegmentColor;
|
Also, we have prepared the sample for your reference. Please find the sample from the below link.
For more details, please refer the below link.
Regards,
Yuvaraj