Skip to content

Instantly share code, notes, and snippets.

@lohithgn
Last active October 27, 2016 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lohithgn/e8bda8d9afd65b771ead217d10501b8b to your computer and use it in GitHub Desktop.
Save lohithgn/e8bda8d9afd65b771ead217d10501b8b to your computer and use it in GitHub Desktop.
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