Changing Y-Axis Values in Elevation Profile Template?

1406
6
08-11-2014 10:35 AM
JonMontgomery
New Contributor

I've been working on customizing a Elevation Profile Template for my organization's trail data. I was wondering if anyone knows how to adjust the y-axis values in the elevation profile chart that is produced. Rather than having numbers like 236.7, 344.9, etc, I'd like the chart to default to y-axis values of 200, 250, 300, etc. I've been trying to do this within the widget.js, but have been unsuccessful so far. If anyone can provide any advice on how to change these values or point me to the right area of the code where these values are generated, it would be greatly appreciated. Thanks!

0 Kudos
6 Replies
GregoryL_Azou
Occasional Contributor III

Hi, you will have more chance to get an answer using the ArcGIS Online‌ space as the elevation template isn't a StoryMaps app.

Thanks

0 Kudos
JonMontgomery
New Contributor

Thanks!

0 Kudos
JohnGrayson
Esri Regular Contributor

Jon, since we need to display the y-axis labels based on the units dropdown of the measurement dijit, we decided to simply generate the labels dynamically by dividing the range of elevation values by 5.  This is something we've talked about revisiting so we'll take another look at this issue and see if there's a simple solution.

0 Kudos
JohnGrayson
Esri Regular Contributor

Jon,

  could you please check out this version of the Elevation Profile Template to see if it does a better job of handling your y-axis labels?

Elevations Profile‌‌

0 Kudos
JonMontgomery
New Contributor

John, thanks for your help. I took the widget.js from the template you linked to and the y-axis looks much better now. Appreciate it!

0 Kudos
JohnGrayson
Esri Regular Contributor

Jon,

     excellent, glad to hear this works better for you.  We switched the approach to letting the dojo chart component calc the appropriate labels, but in order to do that we now convert the elevation and distance values from meters (which is what the profile service returns) to the display units.   You can also find the updated code on my github page: elevation-profile-template