bottom axis ticks/labels only at values

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
RJCookeSE
Newbie
Newbie
Posts: 8
Joined: Fri Feb 17, 2012 12:00 am
Contact:

bottom axis ticks/labels only at values

Post by RJCookeSE » Mon Jul 30, 2012 9:00 pm

Is it possible to have the bottom axis draw ticks and labels only at actual X values? For instance, I'm plotting values for the last day of each month and using Date values as my X values. Necessarily, this means that the X-values are not at regular intervals. I want the axis labels to align with X-values and only draw month-end dates. In the VCL product, I might just use integer values in the X-axis and the OnGetAxisLabel event. I don't immediately see anything like that available for the HTML5 TChart, but maybe I'm missing something. I tried both Line and PointXY series types to see if that made a difference, but I'm only getting ticks at regular intervals.

Thanks,
Rob Cooke

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

Re: bottom axis ticks/labels only at values

Post by Yeray » Fri Aug 10, 2012 7:26 am

Hi Rob,

Excuse us for the delayed reply here.
I'm afraid you are right and the Javascript version doesn't still have the OnGetAxisLabel event. We've added it to the wish list.
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

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

Re: bottom axis ticks/labels only at values

Post by Yeray » Wed Sep 26, 2012 10:44 am

Hi,

We've just implemented the OnGetLabel event in the Javascript version so this should be possible with the next maintenance release.
Ie:

Code: Select all

  Chart1.axes.bottom.labels.ongetlabel=function(value,s) {
    if (value==4) {
       this.format.font.fill="lime";
       this.format.font.style="14px Verdana";
       return "Four";
    }
    else
    {
       this.format.font.fill="black";
       this.format.font.style="11px Tahoma";
       return s;
    }
  }

  Chart1.axes.left.labels.ongetlabel=function(value,s) {
    if (value==6) {
       this.format.font.fill="red";
       this.format.font.style="14px Verdana";
       return "Six";
    }
    else
    {
       this.format.font.fill="black";
       this.format.font.style="11px Tahoma";
       return s;
    }
  }
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