Search code examples
c#asp.netdata-visualizationmschart

datapoints with datetime x axis in asp.net chart control


I am working on asp chart control.

I need to impletment datapoints in my chart having x axis with datetime data.

I go to datapoint concept (not in too deep) but found that it gets only

double

value. My question is how can i assign my datetime values to datapoint on x axis???


Solution

  • Did you try assigning a valid datasource with DateTime property to the Chart. you can set the XValueType property like

    Chart1.Series[0].XValueType = ChartValueType.Date; // or ChartValueType.DateTime
    

    This should work for you.