c# - Setting X axis start to first value in first series, Chart control -
i have chart control on windows form , changed data i'm adding x axis string representing date datetime type.
before changing set minimum x axis 1 one line starts @ y axis i'm using date can't same!
is there simple way start line on chart control @ y axis?
here doing , i'm trying:
chart2.chartareas[0].axisx.minimum = 1;
and adding data chart thus:
seriesave.points.addxy(strdate, average); //strdate string, average double.
i way:
seriesave.points.addxy(dt.date, average); datetime tpdate = datetimepicker1.value; // results in cannot convert datetime double. chart2.chartareas[0].axisx.minimum = tpdate.date;
all x- , y-values in chart
stored doubles
.
when adding value as datetime
gets converted double implicitly tooadate
conversion function.
so when need set value minimum
, maximum
etc need call function in code:
chart2.chartareas[0].axisx.minimum = tpdate.date.tooadate();
to convert datetime
use datetime.fromoadate
function:
datetime tpdate = datetime.fromoadate( chart2.chartareas[0].axisx.minimum);
Comments
Post a Comment