CandleSeries updating issue.

I have syncfusion 16.1.0.37.

I attached an example project

In my simple test I try to replace a candle data with updated data. However every time I try to replace i get bull and bear colors mixed up if I do an in place replace  like
collection[index] = new Candle() or even if I do a Remove(oldCandle) Add(newCandle).

If i use the replace button i get what you see in the picture below, if I press Remove button first and then Add the second candle (the rightmost) is correctly all green.

I tried replacing with Remove then Add and with in place collection[lastindex] = new Candle(), they both yield the same mixed green/red candle.






Attachment: TestSfFinancialChart_9bc055af.zip

1 Reply

MK Muneesh Kumar G Syncfusion Team May 24, 2018 10:30 AM UTC

Hi Claudio, 
 
Thanks for using Syncfusion products.  
 
We are able to reproduce the issue “CandleSegment stroke not updated while replacing the data”, the fix for this issue will be available in our Vol 2 SP1 release, which will be available on end of June, 2018. However, we can resolve this issue by extending CandleSeries and overriding  CreateSegments method as follows. We have modified your sample based on this, please find the sample from the following location.   
 
Code snippet [XAML]: 
<sf:SfChart> 
            <local:CustomCandleSeries 
                 
                ItemsSource="{Binding Candles}" 
                 
                XBindingPath="Date" ComparisonMode="None" 
                 
                High="High" Open="Open" Close="Close" Low="Low"   
                
                BullFillColor="Green" 
                 
                BearFillColor="Red" 
                /> 
            </sf:SfChart> 
 
Code snippet [C#]: 
public class CustomCandleSeries : CandleSeries 
    { 
        public override void CreateSegments() 
        { 
            base.CreateSegments(); 
 
            foreach (CandleSegment segment in Segments) 
            { 
                foreach (Shape item in (segment.GetRenderedVisual() as Panel).Children) 
                { 
                    item.Stroke = segment.ActualStroke; 
                } 
            } 
        } 
    } 
 
 
Please let us know if you have any queries.  
 
Thanks, 
Muneesh Kumar G. 
 


Loader.
Up arrow icon