This topic explains, with code examples, how to configure the tick marks for a chart axis of the {DataChartName}™ control.
The following topics are prerequisites to understanding this topic:
Topic | Purpose |
---|---|
The {DataChartName} control requires a Data set and data binding. This topic demonstrates how to provide a simple Data Object Model. |
|
This topic introduces the types of axes supported by the {DataChartName} control. |
Axis tick marks can be displayed along all horizontal and vertical axes of the {DataChartName} control. When axis tick marks are enabled, a tick mark is displayed for every label (at all major line positions).
Axis tick marks are enabled by setting the TickLength property of an axis to a value greater than 0. (This property specifies the length in pixels of the line segments forming the tick marks.)
Tick marks are always displayed at the axis stroke line and point to the direction of the labels. Labels are offset by the value of the TickLength property to avoid overlapping. For example, for a horizontal axis where the label location is AxisLabelsLocation.OutsideBottom, if the TickLength is set to 5 , labels will be shifted down by 5 pixels.
Note
|
Note:
Tick marks will not be displayed (even if they have valid properties) when the pick:[wpf,win-universal=" LabelSettings"] pick:[wpf,win-universal="property is collapsed"] pick:[xamarin,win-forms=" LabelSettings"] pick:[xamarin,win-forms="property is false"] |
The following table maps the desired configuration to its respective property settings.
In order to configure: | Use this property: | And set it to: |
---|---|---|
The length of the axis tick marks |
The desired length in pixels of the axis tick marks |
|
The thickness of the axis tick marks |
The desired thickness in pixels of the axis tick marks set as a double value |
|
The color of the axis tick marks |
The desired color |
The screenshot below demonstrates how the category x-axis in a {DataChartName} control looks as a result of the following tick-marks-related settings:
Property | Value |
---|---|
“7” |
|
“Red” |
|
“2” |
Following is the code snippet for the chart’s x-axis:
The following topic provides additional information related to this topic.
Topic | Purpose |
---|---|
In the {DataChartName} control, you can change the location, orientation angle, visibility and appearance of the axis label using the AxisLabelSettings object’s properties on any axis. |