histogram scale info doesn't match data

662
1
05-05-2014 07:00 AM
ElizabethAdams
New Contributor
hi all,

I am working on using a histogram time slider to display oil and gas wells permitted in the state of KY. I have limited the amount of data displayed to the last 4 years for a faster download, but have provided a query builder for users that want older data. My problem is that the scale doesn't match the data displayed. Example (I'm displaying data form 1/1/2010 to today but the scale says 12/12/1948 to 10/22/1952 and 1889 and 1890). Can someone help explain how I can format the scale info correctly. I would like each month to be from the 1st to the 30th/31st and not start randomly in the middle, and of course match the data displayed.

Here's a picture of the Histogram

[ATTACH=CONFIG]33586[/ATTACH]

and here's my code I tried to limit it to just the Histogram code

<style>     

      #histogram-container text, #histogram-range,
      #scale-bar-left text, #scale-bar-right text {
        font-family: sans-serif;
  
      }
      #histogram-timeslider-dijit #focusTip {
        font-family: sans-serif;
  
  
      }

</style>

  <script src="//js.arcgis.com/3.6/"></script>
  <script type="text/javascript" language="javascript">

  var OGWells = new FeatureLayer("http://kgs.uky.edu/arcgis/rest/services/KYOilGas/KYOilGasWells_static_time/MapServer/0",
  {id:"OGWells",
   mode: FeatureLayer.MODE_SNAPSHOT,
   outFields: ["*"]
  }); 
OGWells.setDefinitionExpression("date_permit_issued > date '1/1/2010'");

   map.addLayers([OGWells]); 
    
   
    dojo.connect(map, 'onLoad', function (theMap) {
        //resize the map when the browser resizes
        dojo.connect(dijit.byId('map'), 'resize', map, map.resize);
      });
  
       var layerUpdateEnd = OGWells.on("update-end", function() {
            layerUpdateEnd.remove();
            var sliderElem = domConstruct.create("div", {
              id: "timeSlider_"+ map.id, 
              style: "margin-bottom:10px; bottom:33px"
            }, "bottom-div");
            var sliderParams = {
              color: "#005DAB",
        dateFormat: "DateFormat(selector: 'date_permit_issued', fullYear: true)",
              layers : [OGWells],
              mode: "show_all",
              timeInterval: "esriTimeUnitsMonths"
            };
 
            var slider = new HistogramTimeSlider(sliderParams, sliderElem); 
     map.setTimeSlider(slider); 
   
    
            domConstruct.destroy("loading");
   
          }); 
</script>
<body>

        <div style="position:absolute; font-family:Veranda,sans-serif; margin-left:35%; padding-top: 5px";>Drilled Oil and Gas Wells <span id="daterange">2010 to Present Day</span> (Permitted date)</div>
  <div id="timeSlider_mapDiv" class="histogram-timeslider esriTimeSlider" widgetid="timeSlider_mapDiv">
  <div id="histogram-timeslider-dijit" style="height:50px" >
  
 </body>



Thanks for your help!
0 Kudos
1 Reply
JasonTipton
Occasional Contributor III

Having similar issue. Mine is incidents w/in the past 24 hours with a given start/end time. I am trying to use the histogram time slider, but I have 2 issues:

1) The time starts at 12:12 - 1:12 (instead of 12:00 - 1:00)

2) The data counts don't match the data displayed.

Ex: You might move the slider to show all data from 3:12 - 4:12 AM. Half the points have a start time of 10 PM or 7 AM or some other random time. Also, when I look at the raw data, the data counts don't really add up anyway.

One thing you might try is from the layer in ArcMap. Get the Properties > Time and hit calculate for "Layer Time Extent". I don't know if this helps, but I did have a problem with the slider showing the wrong dates, and that may have helped.

0 Kudos