menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum ChartAxisLabelsMode - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Enum ChartAxisLabelsMode

    Represents chart axis labels modes.

    Namespace: Syncfusion.Windows.Chart
    Assembly: Syncfusion.Chart.Wpf.dll
    Syntax
    [Flags]
    public enum ChartAxisLabelsMode
    Remarks

    Apart from the default Labels displayed, you can also add Custom Labels to be displayed in the Chart.

    Examples

    Below given code example illustrates adding labels from custom source

    <syncfusion:Chart Name="Chart1" >
              <syncfusion:ChartArea Name="area" >
                        <syncfusion:ChartArea.PrimaryAxis>
                           <syncfusion:ChartAxis LabelsMode="Custom"
    RangeCalculationMode="AdjustAcrossChartTypes">
                                <syncfusion:ChartAxis.CustomLabels>
                                    <syncfusion:ChartAxisLabel Content="III place"
    Position="0" />
                                   <syncfusion:ChartAxisLabel Content="I place"
    Position="1" />
                                    <syncfusion:ChartAxisLabel Content="II place"
    Position="4" />
                               </syncfusion:ChartAxis.CustomLabels>
                           </syncfusion:ChartAxis>
                       </syncfusion:ChartArea.PrimaryAxis>                 
              </syncfusion:ChartArea>
    </syncfusion:Chart>    
    // Indicates that the axis labels need to be taken from a custom source.
    area.PrimaryAxis.LabelsMode = ChartAxisLabelsMode.Custom;
    ChartAxisLabel customLabel1 = new ChartAxisLabel();
    customLabel1.Content = "III place";
    customLabel1.Position = 0;
    ChartAxisLabel customLabel2 = new ChartAxisLabel();
    customLabel2.Content = "I place";
    customLabel2.Position = 1;
    ChartAxisLabel customLabel3 = new ChartAxisLabel();
    customLabel3.Content = "II place";
    customLabel3.Position = 4;
    // Adding custom label to labels collection.
    area.PrimaryAxis.CustomLabels.Add(customLabel1);
    area.PrimaryAxis.CustomLabels.Add(customLabel2);
    area.PrimaryAxis.CustomLabels.Add(customLabel3); 

    Fields

    Name Description
    Auto

    Content is determined automatically.

    Custom

    Custom values are used for labels content representation.

    DataSource

    External datasource is used for labels content.

    Default

    Content for labels is either determined automatically, taken from external datasource or being set with custom values.

    None

    Labels values are taken from point's X-coordinate.

    See Also
    ChartAxisLabel
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved