diff options
author | Mark Longair <mhl@pobox.com> | 2013-08-19 12:42:22 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-08-20 12:11:45 +0100 |
commit | c8220c5592528463de2f553091d9c0678f12d509 (patch) | |
tree | 6508b155f31ed3abd8bda7e84fe99612af06a639 /public/javascripts/stats-graphs.js | |
parent | e5855f7fd2657574c5af99890c63d530ca3bb5d0 (diff) |
Refer to Javascript object members more idiomatically
Crockford / JSLint suggests using dot notation for referring
to members of objects where possible.
Diffstat (limited to 'public/javascripts/stats-graphs.js')
-rw-r--r-- | public/javascripts/stats-graphs.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/public/javascripts/stats-graphs.js b/public/javascripts/stats-graphs.js index 5d3d52152..9d9ac5b9d 100644 --- a/public/javascripts/stats-graphs.js +++ b/public/javascripts/stats-graphs.js @@ -7,7 +7,7 @@ function zip(arrays) { $(document).ready(function() { $.each(graphs_data, function(index, graph_data) { - var graph_id = graph_data['id'], + var graph_id = graph_data.id, dataset, plot, graph_data, @@ -23,12 +23,12 @@ $(document).ready(function() { 'barWidth': 0.5, 'align': 'center' }, - 'data': zip([graph_data['x_values'], - graph_data['y_values']]) + 'data': zip([graph_data.x_values, + graph_data.y_values]) } ] - if (graph_data['errorbars']) { + if (graph_data.errorbars) { dataset.push({ 'color': 'orange', 'points': { @@ -43,28 +43,28 @@ $(document).ready(function() { 'radius': 5 } }, - 'data': zip([graph_data['x_values'], - graph_data['y_values'], - graph_data['cis_below'], - graph_data['cis_above']]) + 'data': zip([graph_data.x_values, + graph_data.y_values, + graph_data.cis_below, + graph_data.cis_above]) }); } options = { 'xaxis': { - 'ticks': graph_data['x_ticks'], + 'ticks': graph_data.x_ticks, }, 'yaxis': { 'min': 0, - 'max': graph_data['y_max'] + 'max': graph_data.y_max }, 'xaxes': [{ - 'axisLabel': graph_data['x_axis'], + 'axisLabel': graph_data.x_axis, 'axisLabelPadding': 20, 'axisLabelColour': 'black' }], 'yaxes': [{ - 'axisLabel': graph_data['y_axis'], + 'axisLabel': graph_data.y_axis, 'axisLabelPadding': 20, 'axisLabelColour': 'black' }], |