Dashed or dotted line

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Igor
Newbie
Newbie
Posts: 2
Joined: Mon Sep 16, 2013 12:00 am

Dashed or dotted line

Post by Igor » Tue Nov 05, 2013 10:50 am

Hello, is there a way to plot dashed or dotted line? Can't find such property or any example in demos

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Dashed or dotted line

Post by Narcís » Tue Nov 05, 2013 11:43 am

Hi Igor,

Yes, you can do this:

Code: Select all

 function setAxisDash(axis,value) {
  if (value=="solid")
     axis.grid.format.stroke.dash=null;
  else
  if (value=="dash")
     axis.grid.format.stroke.dash=[4,4];
  else
     axis.grid.format.stroke.dash=[2,2];
}
This is a code snippet from the GridBands example at the Axes section in this demo.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Igor
Newbie
Newbie
Posts: 2
Joined: Mon Sep 16, 2013 12:00 am

Re: Dashed or dotted line

Post by Igor » Tue Nov 05, 2013 11:59 am

I got it, thank you very much!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Dashed or dotted line

Post by Narcís » Tue Nov 05, 2013 12:32 pm

Hi Igor,

It would be almost the same:

Code: Select all

Chart1.series.items[0].format.stroke.dash=[4,4];
.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply