Edit Tick Marks on Time Slider

2233
7
Jump to solution
05-13-2016 02:58 PM
NMWater
New Contributor III

Hi all,

I was wondering how to just display the tick marks that correspond to the labels in the time slider?

For example, I want to put a tick mark every January of YYYY.

I'm getting a tick mark for every time interval which is every month from 1984 to 2013.

Thanks for all your help!

Francisco

0 Kudos
1 Solution

Accepted Solutions
TomSellsted
MVP Regular Contributor

You can always just use a number too.

timeSlider.setTickCount(30);

Regards,

Tom

View solution in original post

7 Replies
TomSellsted
MVP Regular Contributor

Fransisco,

You can use the setTickCount method.  Here is a link:

TimeSlider | API Reference | ArcGIS API for JavaScript

Regards,

Tom

NMWater
New Contributor III

Hi Tom,

I've tried the following but I'm still getting some errors. It returns tick marks just on the first and last month of my dataset. Am I missing a parameter??

Labels is a global variable.

Thanks for all your help!

Francisco

0 Kudos
TomSellsted
MVP Regular Contributor

Fransisco,

setTickCount is expecting a number.  Since labels is an array, you could do:

timeSlider.setTickCount(labels.length);

Regards,

Tom

0 Kudos
NMWater
New Contributor III

Thanks for all your help Tom! Unfortunately, I think some part of my labels is undefined as a console.log() is indicating.

Kindest Regards,

Francisco

0 Kudos
TomSellsted
MVP Regular Contributor

You can always just use a number too.

timeSlider.setTickCount(30);

Regards,

Tom

NMWater
New Contributor III

Thanks Tom! This will work!

0 Kudos
TomSellsted
MVP Regular Contributor

Glad that worked for you!

Regards,

Tom

0 Kudos