ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  setting start time of x-axis date label
Posted by Ken Yee on Nov-26-2010 06:16
Hi Peter,

Quick question for you I hope,

I'm calling a chart (.Net) with
LineLayer layer = cTarget.addLineLayer2();
layer.setXData(datatimes);
// localize dates on x-axis
CultureInfo culture = NMSDataLayer.getCulture();
string shortdateformat = culture.DateTimeFormat.ShortDatePattern.ToLower();
cTarget.xAxis().setLabelFormat("{value|" + shortdateformat + " hh:mm}");

datatimes is
11/24/2010 12:00am
11/24/2010 12:10am
11/24/2010 12:20am
11/24/2010 12:30am
11/24/2010 12:40am
11/24/2010 12:50am
etc. (10min intervals)

For some reason, the chartdirector decides to label the x-axis labels as (24hr interval):
11/24/2010 00:11
11/24/2010 04:11
11/24/2010 08:11
11/24/2010 012:11
etc.
and then ends the chart at
11/25/2010

I'm pretty baffled by this...any idea how to force the start of the x-axis to the first datetime that is passed in?
From what I understand, it shouldn't be behaving this way...it should generate the first label using the first datetime value I pass in, but it appears to be offsetting it by 11 minutes.

I also tried forcing it by using setLinearScale like this:
double ostarttime = starttime.ToOADate();
double oendtime = endtime.ToOADate();
cSpeed.xAxis().setLinearScale(ostarttime, oendtime);
but it displays 1/1/01 00:00 as the first date :-(

thanks,

ken

  Re: setting start time of x-axis date label
Posted by Peter Kwan on Nov-27-2010 00:02
Hi Ken,

Note that mm means the month in ChartDirector, not the minute. The minute is nn. So the code should be hh:nn, not hh:mm. In your case, the mm is 11 (the month is Nov), so your time is shown as 12:11 (hour:month).

Hope this can help.

Regards
Peter Kwan

  Re: setting start time of x-axis date label
Posted by ken yee on Nov-27-2010 00:26
LOL...that was embarrassing.

Thanks, Peter :-)