API Improvements in WinUI 3 Charts: 2021 Volume 2 | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
API Improvements in WINUI 3 Charts: 2021 Volume 2

API Improvements in WinUI 3 Charts: 2021 Volume 2

The Syncfusion WinUI 3 Charts control was designed to visually represent a huge amount of data in an elegant way. Its feature set includes data binding, multiple axes, legends, animations, data labels, trackballs, tooltip, gradient, and zooming. In this blog post, we are going to look at the various API changes in our WinUI Charts in the 2021 Volume 2 release. Most importantly, the SfChart control has been deprecated in favor of the following five new controls:

Now, let’s look at them and code examples for them in the new API structure.

Cartesian charts

The WinUI Cartesian chart is one of the basic chart categories. It supports more than 15 chart types such as line, spline, column, bar, area, scatter, and bubble.

For more details about the WinUI Cartesian chart, refer to the demos on GitHub and API documentation.

The following code example shows how to create the WinUI column chart.

<chart:SfCartesianChart Header="Height Comparison">
        <chart:SfCartesianChart.Legends>
            <chart:ChartLegend/>
        </chart:SfCartesianChart.Legend>
        <chart:SfCartesianChart.PrimaryAxis>
            <chart:CategoryAxis Header="Names"/>
        </chart:SfCartesianChart.PrimaryAxis>
        <chart:SfCartesianChart.SecondaryAxis>
            <chart:NumericalAxis Header="Height(in cm)"/>
        </chart:SfCartesianChart.SecondaryAxis>
        <chart:ColumnSeries Label="Heights" ShowTooltip="True"
                            ShowDataLabels="True"
                            ItemsSource="{Binding Data}"
                            XBindingPath="Name" 
                            YBindingPath="Height">
            <chart:ColumnSeries.DataLabelSettings>
                <chart:CartesianDataLabelSettings Position="Inner"/>
            </chart:ColumnSeries.DataLabelSettings>
        </chart:ColumnSeries>
</chart:SfCartesianChart>
WinUI Cartesian (Column) Chart
WinUI Cartesian (Column) Chart

Circular chart

The WinUI Circular chart (pie, doughnut, multiple pie) is user-friendly and gives greater UI visualization of data with proportions and percentages of different categories.

For more details about the WinUI Circular charts, refer to the demos on GitHub and API documentation.

The following code example shows how to create the WinUI pie chart.

<chart:SfCircularChart Header="Number of Internet Users in World (Users In Millions)">
    <chart:SfCircularChart.Legend>
        <chart:ChartLegend/>
    </chart:SfCircularChart.Legend>
    <chart:SfCircularChart.Series>
        <chart:DoughnutSeries ItemsSource="{Binding Data}" XBindingPath="Category" 
                              YBindingPath="Value1" ShowDataLabels="True" 
                              ShowTooltip="True" >
        </chart:DoughnutSeries>
    </chart:SfCircularChart.Series>
</chart:SfCircularChart>
WinUI Circular (Pie) Chart
WinUI Circular (Pie) Chart

Polar chart

The WinUI Polar chart is used to visualize data in terms of values and angles. It visually compares several quantitative or qualitative aspects of a situation. It is a variant of the radar chart (spider chart).

For more details about the WinUI Polar chart, refer to the demos on GitHub and API documentation.

The following code example shows how to use the WinUI Polar chart to design a radar chart by specifying the GridLineType property as Polygon.

<chart:SfPolarChart Header="Radar Chart" GridLineType="Polygon">
      <chart:SfPolarChart.PrimaryAxis>
           <chart:CategoryAxis />
      </chart:SfPolarChart.PrimaryAxis>
      <chart:SfPolarChart.SecondaryAxis>
           <chart:NumericalAxis/>
      </chart:SfPolarChart.SecondaryAxis>
      <chart:SfPolarChart.Series>
           <chart:PolarAreaSeries  ItemsSource="{Binding PlantDetails}"
                                   XBindingPath="Direction" YBindingPath="Tree" >
           </chart:PolarAreaSeries>
       </chart:SfPolarChart.Series>
</chart:SfPolarChart>
Designing a Radar Chart Using WinUI Polar Chart
Designing a Radar Chart Using WinUI Polar Chart

Pyramid chart

The WinUI Pyramid chart is used to visually represent hierarchies in a pyramid-like structure that shows the proportions of a total.

For more details about the WinUI Pyramid chart, refer to the demos on GitHub and API documentation.

The following code example shows how to create the WinUI Pyramid chart.

<chart:SfPyramidChart Header="PRODUCT SALES"
            ShowTooltip="True" ShowDataLabels="True" Palette="BlueChrome"
            ItemsSource="{Binding Data}" XBindingPath="Product" YBindingPath="Value">
       <chart:SfPyramidChart.Legend>
             <chart:ChartLegend />
       </chart:SfPyramidChart.Legend>
</chart:SfPyramidChart>
WinUI Pyramid Chart
WinUI Pyramid Chart

Funnel chart

The WinUI Funnel chart is used to plot streamlined data to show various stages in a process.

For more details about the WinUI Funnel chart, refer to the demos on GitHub and API documentation.

The following code example shows how to create the WinUI Funnel Chart.

<chart:SfFunnelChart Header="PRODUCT SALES"
                     ShowTooltip="True" ShowDataLabels="True" Palette="BlueChrome"
                     ItemsSource="{Binding Data}" XBindingPath="Product" YBindingPath="Value">
    <chart:SfFunnelChart.Legend>
        <chart:ChartLegend />
    </chart:SfFunnelChart.Legend>
</chart:SfFunnelChart>
WinUI Funnel Chart
WinUI Funnel Chart

Note: Also, refer to the WinUI Charts feature tour page, and demos on the App Center.

API breaking changes

Let’s discuss the API-breaking changes in the WinUI Charts control that rolled out in the 2021 Volume 2 release.

Classes

Previous ClassCurrent Class
SfChartSfCartesianChart

SfCircularChart

SfPolarChart

SfPyramidChart

SfFunnelChart

ChartDataMarkerCartesianDataLabelSettings

CircularDataLabelSettings

PyramidDataLabelSettings

FunnelDataLabelSettings

PolarDataLabelSettings

ChartDataMarkerLabelChartDataLabel

Property

ClassPrevious APICurrent API
ChartSeriesDataMarkerDataLabelSettings
SfChartAreaBackground

AreaBorderThickness

AreaBorderBrush

SideBySideSeriesPlacement

PlotAreaBackground

PlotAreaBorderThickness

PlotAreaBorderBrush

EnableSideBySideSeriesPlacement

ChartSelectionBehaviorSelectionCursor

SelectionType

Cursor

Type

ChartSelectionBehaviorThe following properties have been removed.

EnableSegmentSelection

EnableSeriesSelection

SelectionMode

The following new enum SelectionType values have been added.

Point

Series

MultiPoint

MultiSeries

UG link – Selection

ChartDataMarkerShowLabelShowDataLabels ( Moved from ChartDataMarker to ChartSeriesBase.)

Note: For more details, refer to the API Breaking Changes in the 2021 Volume 2: WinUI Charts documentation.

Conclusion

Thanks for reading! We have seen the API improvements and breaking changes in our Syncfusion WinUI 3 Charts control in the 2021 Volume 2 release. These updates are available in our Release Notes and What’s New pages, too. So, try out them and leave your feedback in the comments section of this blog post!

For existing customers, the newest version is available for download from the License and Downloads page. If you are not yet a Syncfusion customer, you can try our 30-day free trial to check out the available features. Also, you can try our samples on GitHub.

You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed