Commit ff5fd5bf6ad3ec7625f08dcc8eacbd93f4810696

Authored by hitier
1 parent 25ec6dd7

Less and Longer Y ticks

app/main/static/css/charges.css
  1 +.horizontalY {
  2 + /*fill : none;*/
  3 + shape-rendering : crispEdges;
  4 + stroke : lightgrey;
  5 + stroke-width : 1px;
  6 +}
  7 +.horizontalY0 {
  8 + stroke-width : 0px;
  9 +}
1 10  
2 11 #charge_table,
3 12 #charge_table th,
... ...
app/main/static/js/charges.js
... ... @@ -2,12 +2,16 @@ const margin = {top: 60, right: 350, bottom: 100, left: 90},
2 2 width = 1300 - margin.left - margin.right,
3 3 height = 500 - margin.top - margin.bottom;
4 4  
  5 +const height_ratio = 1.2
  6 +
5 7 const tooltip_offset = {dx: 0, dy: 100}
6 8  
7 9 const color_scale = d3.scaleOrdinal(d3.schemeCategory10);
8 10  
  11 +const y_ticks_num = 5
  12 +
9 13 const legend_cell_size = 15; // colored scare size
10   -const legend_x = width+20; // begin legend a bit after the end of the chart
  14 +const legend_x = width + 20; // begin legend a bit after the end of the chart
11 15  
12 16 // TODO: set main scales attr here then domain later
13 17 // const x = d3.scaleBand()
... ... @@ -71,7 +75,7 @@ function build_chart(div_selector, data_url, project_name, category) {
71 75 let reverse_keys = color_scale.domain().reverse();
72 76  
73 77 let legend = svg.append('g')
74   - .attr('transform', 'translate('+legend_x+', -30)');
  78 + .attr('transform', 'translate(' + legend_x + ', -30)');
75 79  
76 80 legend.selectAll()
77 81 .data(reverse_keys)
... ... @@ -147,14 +151,15 @@ function build_chart(div_selector, data_url, project_name, category) {
147 151 if (y_max == 0) {
148 152 y_max = 100
149 153 }
150   - // Enhance it by 10% to leave room on the top of the graph
151