0
Answer

MSCHART Unable to display more than 24 hours

Kong Weng Lee

Kong Weng Lee

11y
1.8k
1

Hi there,

I'm using MS Chart to create chart.

I have multiple series of points that i generate using datetime data format.

but for data which pass the 1159pm, the chart can't show on the next day.

It's shown on the same day, for example most of the points are within 0000-2400 day1 but i have point with 0045 day2 but it is still shown in day1 0045. Here are the parts of the codes

           

m_TeamsPeriodChart.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Minutes;
m_TeamsPeriodChart.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Minutes;
m_TeamsPeriodChart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;

.

.

.

m_TeamsPeriodChart.Series[i].XValueType = ChartValueType.Time; 

.

.

.

DateTime baseDate = DateTime.Today;
var xDate = baseDate;
var xDate2 = baseDate;

.

.

.

xDate = baseDate.AddMinutes(startTime);
m_TeamsPeriodChart.Series[i].Points.AddXY( xDate, teamNo);
xDate2 = baseDate.AddMinutes(endTime);
m_TeamsPeriodChart.Series[i].Points.AddXY( xDate, teamNo);

thanks.