Syncfusion Feedback


Overview

The .NET MAUI stacked line chart visualizes data with y-values stacked one over another in a series. It shows the relationship between individual values to the total sum of the points. Create beautiful, animated, real-time, high-performance stacked line charts that also support interactive features such as zooming, panning, trackballs, and tooltips.

.NET MAUI Stacked Line Chart documentation

.NET MAUI stacked line chart.


Key features

.NET MAUI stacked line chart with data labels.

Data labels

Data labels display information about data points. Customize the label’s foreground, border, and background. Rotate a data label by a specified angle.

.NET MAUI vertical stacked line chart.

Vertical chart

The stacked line chart can be transposed vertically to view data from a different perspective.

.NET MAUI stacked line chart with different markers.

Marker

Data points in a stacked line chart are visualized as marks using built-in symbols such as crosses, squares, plus signs, inverted triangles, hexagons, ellipses, vertical lines, horizontal lines, diamonds, triangles, and pentagons.

.NET MAUI stacked line chart with multiple axes.

Multiple axes

Use multiple axes to plot different data sets along two or more axes, each with different data points and values.


Code example

  1. <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  3. x:Class="ChartExample.MainPage"
  4. xmlns:local="using:ChartExample"
  5. xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts">
  6. <Grid>
  7. <chart:SfCartesianChart HorizontalOptions="FillAndExpand"
  8. VerticalOptions="FillAndExpand">
  9. <!--Setting BindingContext-->
  10. <chart:SfCartesianChart.BindingContext>
  11. <local:ViewModel/>
  12. </chart:SfCartesianChart.BindingContext>
  13.  
  14. <!--Initialize the horizontal axis for the .NET MAUI Cartesian Chart.-->
  15. <chart:SfCartesianChart.XAxes>
  16. <chart:CategoryAxis/>
  17. </chart:SfCartesianChart.XAxes>
  18.  
  19. <!--Initialize the vertical axis for the .NET MAUI Cartesian Chart.-->
  20. <chart:SfCartesianChart.YAxes>
  21. <chart:NumericalAxis/>
  22. </chart:SfCartesianChart.YAxes>
  23. <!--Adding Stacked Line Series to the .NET MAUI Cartesian Chart.-->
  24. <chart:SfCartesianChart.Series>
  25. <chart:StackingLineSeries
  26. ItemsSource="{Binding Data}"
  27. XBindingPath="Name"
  28. YBindingPath="High"
  29. ShowMarkers="True">
  30. </chart:StackingLineSeries>
  31. <chart:StackingLineSeries
  32. ItemsSource="{Binding Data}"
  33. XBindingPath="Name"
  34. YBindingPath="Low"
  35. ShowMarkers="True">
  36. </chart:StackingLineSeries>
  37. <chart:StackingLineSeries
  38. ItemsSource="{Binding Data}"
  39. XBindingPath="Name"
  40. YBindingPath="Value"
  41. ShowMarkers="True">
  42. </chart:StackingLineSeries>
  43. <chart:StackingLineSeries
  44. ItemsSource="{Binding Data}"
  45. XBindingPath="Name"
  46. YBindingPath="Size"
  47. ShowMarkers="True">
  48. </chart:StackingLineSeries>
  49. </chart:SfCartesianChart.Series>
  50. </chart:SfCartesianChart>
  51. </Grid>
  52. </ContentPage>
  1. public class Model
  2. {
  3. public string Name { get; set; }
  4. public double High { get; set; }
  5. public double Low { get; set; }
  6. public double Value { get; set; }
  7.  
  8. public double Size { get; set; }
  9.  
  10. public Model(string name, double high, double low, double value,double size)
  11. {
  12. Name = name;
  13. High = high
  14. Low = low
  15. Value = value
  16. Size = size
  17. }
  18. }
  19.  
  20. public class ViewModel
  21. {
  22. public ObservableCollection<Model> Data { get; set; }
  23.  
  24. public ViewModel()
  25. {
  26. Data = new ObservableCollection<Model>()
  27. {
  28. new Model("Mon", 100,90,60,150),
  29. new Model("Tue", 120,100,80,140),
  30. new Model("Wed", 140,120,90,160),
  31. new Model("Thu", 160,140,100,180),
  32. new Model("Fri", 160,140,100,180),
  33. new Model("Sat", 160,140,100,180),
  34. };
  35. }
  36. }

Learning resources

Navigate to GitHub code used to configure the .NET MAUI stacked line chart.

GitHub Code

The .NET MAUI stacked line chart configuration code is available on GitHub.

Navigate to the user guide to explore the customization options available in the .NET MAUI stacked line chart.

.NET MAUI Stacked Line Chart User Guide

Explore the customization options available for the .NET MAUI stacked line chart.

Navigate to the API reference documentation of the .NET MAUI stacked line chart.

.NET MAUI stacked line chart API reference

Explore the .NET MAUI stacked line chart APIs.

Scroll up icon
Chat with us