Articles in this section
Category / Section

How to apply different colors in ASP.NET MVC Chart for the points in a series?

1 min read

Essential Chart allows you to customize the color and border of each point in the series by using Fill and Border properties of points. Column type series like column, bar, etc., and financial type series like Candle, Hilo, and Hilo-open-close, scatter, and bubble series support customizing each point in a series. This is not applicable to the series types like line, area, pie, polar, etc., drawn by using the SVG path element.

 

    @(Html.EJ().Chart("container")
        . . . . . . .
        . . . . . . . 
        .Series(series =>
        {
            series.Name("Gold").Points(
                points =>
                {
                    points.X("Usa").Y(50).Fill("gold")
                        .Border(border=>border.Color("black").Width(2)).Add();                   
                    points.X("Australia").Y(60).Add();
                    points.X("France").Y(50).Fill("#3ef34c")
                        .Border(border=>border.Color("black").Width(2)).Add();
                }).Add();
                . . . . . . . . . .
                . . . . . . . . . .
        }
    )
  )

 

The output of the above code is similar to the following screenshot.

Different colors for the points in a series

Figure 1: Chart using different colors for third and fifth points

 

Sample Link: Chart Customization


Conclusion

I hope you enjoyed learning about how to apply different colors for the points in a series

You can refer to our ASP.NET MVC Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied