eladam2

histogram scale info doesn't match data

Discussion created by eladam2 on May 5, 2014
Latest reply on Oct 14, 2014 by jason.tipton.gis
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!

Attachments

Outcomes