Last active
October 27, 2016 07:45
-
-
Save lohithgn/e8bda8d9afd65b771ead217d10501b8b to your computer and use it in GitHub Desktop.
Setting X Axis of the chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set up x-axis | |
var xAxis = plotArea.XAxis; | |
xAxis.AxisCrossingValue = 0; | |
xAxis.Color = Color.Black; | |
xAxis.MajorTickType = TickType.Outside; | |
xAxis.MinorTickType = TickType.None; | |
xAxis.Reversed = false; | |
var axisItemCollection = xAxis.Items; | |
axisItemCollection.AddRange(new List<AxisItem>() | |
{ | |
new AxisItem("Monday"), | |
new AxisItem("Tuesday"), | |
new AxisItem("Wednesday"), | |
new AxisItem("Thursday"), | |
new AxisItem("Friday"), | |
new AxisItem("Saturday"), | |
new AxisItem("Sunday"), | |
}); | |
xAxis.LabelsAppearance.DataFormatString = "{0}"; | |
xAxis.LabelsAppearance.RotationAngle = 0; | |
xAxis.TitleAppearance.Text = "Days"; | |
xAxis.TitleAppearance.Position = AxisTitlePosition.Center; | |
xAxis.MajorGridLines.Width = 1; | |
xAxis.MinorGridLines.Width = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment