How to make x values start from yaxis in MS Chart?

  • Thread starter Thread starter sgrm123
  • Start date Start date
S

sgrm123

Guest
Hi,


1441451.png

In my application I am plotting datetime in x axis and interger in y axis.

How to make x values start from yaxis in MS Chart?

this is my code.

chart.ChartAreas["history"].AxisX.Title = "X Axis";
chart.ChartAreas["history"].AxisX.MajorGrid.LineColor = System.Drawing.Color.Black;

chart.ChartAreas["history"].AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;

chart.ChartAreas["history"].AxisY.Minimum = 0;
chart.ChartAreas["history"].AxisY.Maximum = 1000;
chart.ChartAreas["history"].AxisY.Interval = 250;
chart.ChartAreas["history"].AxisY.Title = "Y Axis";
chart.ChartAreas["history"].AxisY.MajorGrid.LineColor = Color.Black;
chart.ChartAreas["history"].AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chart.ChartAreas["history"].BackColor = Color.White;
chart.ChartAreas["history"].AxisX.Interval = 1;
chart.ChartAreas["history"].AxisX.LabelStyle.Angle = -90;
chart.ChartAreas["history"].AxisX.LabelStyle.Format = "dd-MM-yyyy hh:mm:ss";

Continue reading...
 
Back
Top