0
votes

Hello I am using MSCHARTS to draw a graph.

I currently created my chart area and my series. I used datetime date = 12/31/2015 and it gives me the next day which would be 01/01/2016 , this is not what i want.

How would i fix this?

ichart.Series[0].Points.AddXY(datetime date, myvalue);

for my axis X interval type i pass it date time intervaltype.years.

is there a way to customize what I see on my X axis?

1
Do i need to set a minimum value - artbarzz

1 Answers

1
votes

I think what you need is Axis.IntervalOffsetType: https://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.axis.intervaloffsettype(v=vs.110).aspx

and Axis.IntervalOffset: https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.axis.intervaloffset(v=vs.110).aspx

In your case

chart1.ChartAreas[0].AxisX.IntervalOffsetType = DateTimeIntervalType.Days;
chart1.ChartAreas[0].AxisX.IntervalOffset = -1;

should fix the problem.

I hope this helps!