Skip to content

Instantly share code, notes, and snippets.

@lohithgn

lohithgn/X_Axis.cs

Last active Oct 27, 2016
Embed
What would you like to do?
Setting X Axis of the chart
//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
You can’t perform that action at this time.