time date scale on graph with no data

TeeChart for Javascript for the HTML5 Canvas
Post Reply
samos
Newbie
Newbie
Posts: 19
Joined: Mon Jun 17, 2013 12:00 am

time date scale on graph with no data

Post by samos » Wed Dec 10, 2014 7:34 am

When there is no data on the graph the time/date scale is not visible.
Is there a way to show the time scale also when there is no data on the graph?

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

Re: time date scale on graph with no data

Post by Yeray » Wed Dec 10, 2014 12:03 pm

Hello,

In TeeChart HTML5/Javascript, a Chart needs a series with at least one value to draw the axes. But it can be a null point. Ie:

Code: Select all

  Chart1=new Tee.Chart("canvas1");
  Chart1.legend.visible=false;

  Chart1.addSeries(new Tee.PointXY([null]));//.addRandom(1);
  
  Chart1.axes.left.setMinMax(0, 100);
  Chart1.axes.bottom.setMinMax(0, 100);
  
  Chart1.draw();
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

samos
Newbie
Newbie
Posts: 19
Joined: Mon Jun 17, 2013 12:00 am

Re: time date scale on graph with no data

Post by samos » Wed Dec 10, 2014 1:08 pm

This is not working well, when i add null series the format of my bottom axess is not Date/Time as I set it and it shows number.
In this specific chart I have only one Gant serie.
What I did to resolve the problem is add null point
mySer.add(null, null, startTime, startTime)


Thanks,
Amos

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

Re: time date scale on graph with no data

Post by Yeray » Wed Dec 10, 2014 2:46 pm

Hi Amos,
samos wrote:This is not working well, when i add null series the format of my bottom axess is not Date/Time as I set it and it shows number.
In this specific chart I have only one Gant serie.
What I did to resolve the problem is add null point
mySer.add(null, null, startTime, startTime)
Sorry, I missed the DateTime part.
I'm glad to hear you found how to achieve it though!
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