Page 1 of 1

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

Posted: Thu Apr 24, 2014 12:03 am
by 9337315
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";

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

Posted: Thu Apr 24, 2014 1:38 pm
by yeray
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.