display charts correctly even when invalid min/max values are present

This commit is contained in:
Lee Lawlor
2014-10-07 12:20:49 -04:00
parent 3a4906adf1
commit edd3644654
5 changed files with 78 additions and 3 deletions

View File

@ -96,13 +96,19 @@
<div class="helplink">(<a href="/docs/react"><%= t(:help_options) %></a>)</div>
</h3>
<%= t(:help_apps_react) %>
<br><br>
<h3>
<%= t(:talkback) %>
<div class="helplink">(<a href="/docs/talkback"><%= t(:help_options) %></a>)</div>
</h3>
<%= t(:help_apps_talkback) %>
<br><br>
<h3>
<%= t(:timecontrol) %>
<div class="helplink">(<a href="/docs/timecontrol"><%= t(:help_options) %></a>)</div>
</h3>
<%= t(:help_apps_timecontrol) %>
</div>
</div>

View File

@ -44,7 +44,7 @@
// add location if possible
if (this.location) { p.name = this.location; }
// if a numerical value exists add it
if (!isNaN(parseInt(v))<% if params[:max] %> && p.y <= <%= params[:max]%><% end %><% if params[:min] %> && p.y >= <%= params[:min]%><% end %>) { chartData.push(p); }
if (!isNaN(parseInt(v))<% if params[:max].present? && Feed.numeric?(params[:max]) %> && p.y <= <%= params[:max] %><% end %><% if params[:min].present? && Feed.numeric?(params[:max]) %> && p.y >= <%= params[:min] %><% end %>) { chartData.push(p); }
});
// specify the chart options
@ -97,7 +97,7 @@
shift = true ;
}
// if a numerical value exists and it is a new date, add it
if (!isNaN(parseInt(v)) && (p.x != last_date)<% if params[:max] %> && p.y <= <%= params[:max]%><% end %><% if params[:min] %> && p.y >= <%= params[:min]%><% end %>) {
if (!isNaN(parseInt(v)) && (p.x != last_date)<% if params[:max].present? && Feed.numeric?(params[:max]) %> && p.y <= <%= params[:max] %><% end %><% if params[:min].present? && Feed.numeric?(params[:min]) %> && p.y >= <%= params[:min] %><% end %>) {
dynamicChart.series[0].addPoint(p, true, shift);
}
else {