What’s New in 2018 Volume 2: Xamarin Chart Updates | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)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  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)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  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

What’s New in 2018 Volume 2: Xamarin Chart Updates

We are excited to announce updates for our very popular Xamarin chart control in the 2018 Volume 2 release. The focus of this release for the chart component is to support macOS on Xamarin platforms, and other usability related features and improvements based on customer feedback. Here are all the planned updates:

  • Chart support for macOS in Xamarin.Forms (preview).
  • Attribute support for designing in AXML files in Xamarin.Android.
  • Date-time category axis support.
  • “Others” category in pie and doughnut series for grouping small data points.
  • Ability to add text to the center of doughnut charts.
  • Different shape types in scatter series.
Let’s take a deeper look at each of these features.

Chart supports macOS in Xamarin.Forms (preview)

It’s been more than three years since the release of Xamarin.Forms, and it’s been aggressively improved by adding support for more platforms, implementing dozens of new features, and providing greater stability. We at Syncfusion closely monitor changes in Xamarin.Forms and continue to ensure our controls always work with the latest version. Now, we will begin adding support for the macOS platform in our Xamarin.Forms controls, starting with the chart, data grid, and list view. The Xamarin.Forms for macOS versions of our controls will support the same features that are available in the other Xamarin.Forms platforms. To include the macOS platform as a target in your existing Xamarin.Forms project, create a new Xamarin.Mac project and add the Xamarin.Forms libraries as explained in this blog. Next, add the Syncfusion.Xamarin.SfChart NuGet package or the necessary assemblies inside the macOS folder to include the chart component. That’s it! Now your app is ready to be installed in a Mac machine with a beautiful chart control.

Attribute support for designing in AXML files in Xamarin.Android

What else would help reduce layout design time in Xamarin.Android apps? How about being able to see a preview of an entire layout in the designer, with proper rendering of all the views and the actual output. In 2018 Volume 2, the chart control for Xamarin.Android will be rendered in the designer when you drag and drop from the toolbox, and also support attributes for customizing the appearance. With these improvements, it is no longer a requirement to deploy the app in a device or emulator to check the output of your layout for every change.

Xamarin.Android project with layout preview

Date-time category axis support

A date-time category axis is one of the most requested features from our customers. It allows users to plot date-time values without a visual gap between two data points. It is similar to a category axis, but the ranges and interval are calculated based on the date-time value. The following code example shows how to create the DateTimeCategoryAxis and set it to the PrimaryAxis property.
 <chart:SfChart.PrimaryAxis>
 
            <chart:DateTimeCategoryAxis/>
 
  </chart:SfChart.PrimaryAxis>

Chart with date-time category axis

Group small data points into “others” category in pie and doughnut series

When there are so many data points in a pie or doughnut chart that it is difficult to see the smallest slices, one solution is to group the smallest values into an “Others” category. Support for this behavior has been added to the Xamarin chart component in 2018 Volume 2. It can be configured using two properties: GroupMode, which specifies the grouping type to be based on slice angle, actual data point value, or percentage; and GroupTo, which sets the limit to group data points into a single slice. The following code example shows how to group the segments in a pie series.
<chart:PieSeries GroupMode="Value" GroupTo="25" ExplodeOnTouch="True" EnableTooltip="True" ItemsSource="{Binding PieData}" XBindingPath="Name" YBindingPath="Value"/>

Pie chart with “Others” category

Add text to the center of a doughnut chart

Text or any view can be added at the center of a doughnut chart to show any information about the data presented. It is typically used to show information about a selected doughnut slice or any other information about the visualized data. The binding context of the center view will be the chart series so that you can make use of data binding to display any information from the chart series. The following code example shows how to set up the center view of a doughnut chart and how to bind some properties from ViewModel.
     
<chart:DoughnutSeries ItemsSource="{Binding DoughnutSeriesData}" XBindingPath="Name" YBindingPath="Value"  ExplodeOnTouch="true" EnableDataPointSelection="true">
 
                    <chart:DoughnutSeries.CenterView>
                        <StackLayout Orientation ="Vertical">
                            <Label Text="{Binding BindingContext.SelectedItemName}"/>
                            <Label Text="{Binding BindingContext.SelectedItemPercentage}" FontSize="12"/>
                        </StackLayout>
                    </chart:DoughnutSeries.CenterView>
 
 </chart:DoughnutSeries>

Doughnut chart with text in center

Different shapes in scatter series

Previously, we have relied on data marker symbols and assigning series a transparent color to plot scatter charts with different shapes. Now we have added support for shapes, and you can directly configure them in scatter series by using the ShapeType property. The available shapes are cross, diamond, ellipse, hexagon, inverted triangle, pentagon, plus, rectangle, and triangle. The following code example shows how to set up a scatter chart with default and diamond shapes.
            <chart:SfChart.Series>
                <chart:ScatterSeries ItemsSource="{Binding Male}" Label="Male" XBindingPath="Height" YBindingPath="Value"/>
                <chart:ScatterSeries ScatterType="Diamond" ItemsSource="{Binding Female}" Label="Female" XBindingPath="Height" YBindingPath="Value"/>
            </chart:SfChart.Series>

Scatter chart with different shapes

This is not a complete list of all the Xamarin chart features added in 2018 Volume 2. We have a few more minor improvements in the works, such as adding separate views for each annotation and series, exposing events and methods to get touch actions on annotations, adding events for data marker creation, and trackball movement actions, along with bug fixes. Download our 2018 Volume 2 release of Essential Studio for Xamarin from the following link:

https://www.syncfusion.com/downloads/xamarin

Post your comments below if you have any questions or feedback. We are happy to offer any help we can!

If you like this blog post, we think you’ll also like the following free e-books:

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed