aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/static/new/javascript/comparison_bar_chart.js
blob: 5e73807c41296461cd683d1cdc80826ab239239b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
generate_traces = function() {
  traces = [];
  for (i = 0, _len = js_data.traits.length; i < _len; i++) {
    this_trace = {
      x: js_data.samples,
      y: js_data.sample_data[i],
      name: js_data.traits[i],
      type: 'bar',
      bargap: 20
    }

    traces.push(this_trace)   
  }

  return traces
}

create_bar_chart = function() {
  var data = generate_traces()
  var layout = {barmode: 'group', bargap: 5};

  Plotly.newPlot('comp_bar_chart', data, layout);
}

create_bar_chart();