Datetime axis--Need it to show actual dates or Monday dates

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
WCantrall
Newbie
Newbie
Posts: 27
Joined: Mon May 03, 2004 4:00 am
Location: USA
Contact:

Datetime axis--Need it to show actual dates or Monday dates

Post by WCantrall » Thu Apr 24, 2014 12:03 am

I have weekly datetime data that starts on 14 Oct 2013 (a Monday) and goes on for a number of months. When I set the increment to weekly (7 * 86400000) the labels appear at Wednesday dates rather than Monday dates. How can I force the labels to show either 1. Monday days of the week (is there something I can override?) or 2. Force the labels to only show up at datapoints where there is actual data in the series?
Thanks!

var axis = Chart1.axes.bottom;
axis.increment = 7 * 86400000;
axis.setMinMax(Chart1.series.items[0].minXValue(),Chart1.series.items[0].maxXValue());
axis.labels.dateFormat = "dd-mmm-yy";

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Datetime axis--Need it to show actual dates or Monday dates

Post by Yeray » Thu Apr 24, 2014 1:38 pm

Hello,
WCantrall wrote:How can I force the labels to show either 1. Monday days of the week (is there something I can override?)
The axis roundMin function is called a the beginning of drawLabels() function. You can override the roundMin function to make the first label to start where you want. Ie:

Code: Select all

  axis.roundMin=function() {
	return this.minimum;
  }
WCantrall wrote:2. Force the labels to only show up at datapoints where there is actual data in the series?
You could override the whole drawLabels function to do this:

Code: Select all

  axis.drawLabels=function() {
  //...
  }
But some of the other TeeChart versions have a PointValue LabelStyle, so we could implement the corresponding labelStyle in TeeChart Javascript too.
I've added it to the wish list list to be implemented in future releases:
http://bugs.teechart.net/show_bug.cgi?id=741
Feel free to add your mail to the CC list to be automatically notified when an update arrives.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply