Different color for negative numbers on column series (SfChart)

Hi,


I am using Syncfusion.Blazor version 18.3.0.48


I have SfChart component (using column series) which has been working great, but I'd like it to have a different color when the number(s) are negative. Using NegativeFillColor seems to only work for waterfall, and not column. Is there  an alternative to make it work on columns?


3 Replies

DG Durga Gopalakrishnan Syncfusion Team July 19, 2021 11:34 AM UTC

Hi Eric, 

Greetings from Syncfusion. 

We suggest you to use OnPointRender event to customize the chart series point based on y value. We have prepared sample based on your requirement and attached for your reference.  

<SfChart> 
    <ChartEvents OnPointRender="PointRenderEvent"></ChartEvents> 
</SfChart> 
@code{ 
public void PointRenderEvent(PointRenderEventArgs args) 
    { 
        if (args.Point.YValue < 0) 
            args.Fill = "red"; 
    } 
} 

 


Kindly revert us if you have any concerns. 

Regards, 
Durga G  



ER Eric July 20, 2021 03:57 PM UTC

Hi Durga,


Thank you so much for the quick reply. Sorry for my delay on responding, having a newborn around has really cut the time I have available to try to work. 

Is there something which would work on the version I am currently using ( 18.3.0.48)? OnPointRender does not seem to be an option there.

Best regards,

Eric


2) 



DG Durga Gopalakrishnan Syncfusion Team July 21, 2021 08:25 AM UTC

Hi Eric, 

We have not provided support for OnPointRender event in version 18.3.48. We request you to use the latest version to work on this event. Please revert us if you have any concerns. 

Regards, 
Durga G 


Loader.
Up arrow icon