Articles in this section
Category / Section

The use of common series options in ASP.NET MVC Chart.

2 mins read

The CommonSeriesOptions property provides options to customize marker, data label, and other properties of all the series in the ASP.NET MVC Chart. Except the Points property, all the other properties in the series are customizable by using the CommonSeriesOptions property.

For example, changing the marker shape in the CommonSeriesOptions changes the marker shape of all the series. To customize marker and other properties for a specific series, values should be provided to the properties of that specific series in series collection. In general, values provided to the series in series collection overrides the values provided through the CommonSeriesOptions.

CSHTML

@(Html.EJ().Chart("chart")
 .CommonSeriesOptions(options=>
     options.Marker(m=>m.Visible(true)))
 .Series(s =>
 {
     s.Points(p => {
         p.X("1").Y(35).Add();
         p.X("2").Y(26).Add();
         p.X("3").Y(51).Add();
         p.X("4").Y(69).Add();
       })
      .Marker(m =>
         m.Fill("blue").Size(sz => sz.Width(10).Height(10))
      )
      .Add();
    s.Points(p =>
     {
         p.X("1").Y(72).Add();
         p.X("2").Y(29).Add();
         p.X("3").Y(48).Add();
         p.X("4").Y(39).Add();
     })
     .Add();
    s.Points(p =>
    {
        p.X("1").Y(52).Add();
        p.X("2").Y(58).Add();
        p.X("3").Y(32).Add();
        p.X("4").Y(11).Add();
    })
     .Add();
 })
  )

The following screenshot displays the Chart with markers enabled by using the CommonSeriesOptions and marker fill color customized specifically for first series in the Series collection.

The use of commonSeriesOptions in Chart

Conclusion

I hope you enjoyed learning about the use of commonSeriesOptions in the ASP.NET MVC Chart.

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