Commit 8fb84104e4c50c77d1ec66ebf207b057fa58f043
1 parent
d40e6bc2
Exists in
master
and in
4 other branches
Use graph ticks to make axis more readable
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
app/assets/javascripts/stat_graph_contributors_graph.js.coffee
| ... | ... | @@ -71,7 +71,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph |
| 71 | 71 | super @width, @height |
| 72 | 72 | create_axes: -> |
| 73 | 73 | @x_axis = d3.svg.axis().scale(@x).orient("bottom") |
| 74 | - @y_axis = d3.svg.axis().scale(@y).orient("left") | |
| 74 | + @y_axis = d3.svg.axis().scale(@y).orient("left").ticks(5) | |
| 75 | 75 | create_svg: -> |
| 76 | 76 | @svg = d3.select("#contributors-master").append("svg") |
| 77 | 77 | .attr("width", @width + @MARGIN.left + @MARGIN.right) |
| ... | ... | @@ -130,8 +130,8 @@ class window.ContributorsAuthorGraph extends ContributorsGraph |
| 130 | 130 | create_scale: -> |
| 131 | 131 | super @width, @height |
| 132 | 132 | create_axes: -> |
| 133 | - @x_axis = d3.svg.axis().scale(@x).orient("bottom").tickFormat(d3.time.format("%m/%d")); | |
| 134 | - @y_axis = d3.svg.axis().scale(@y).orient("left") | |
| 133 | + @x_axis = d3.svg.axis().scale(@x).orient("bottom").ticks(8) | |
| 134 | + @y_axis = d3.svg.axis().scale(@y).orient("left").ticks(5) | |
| 135 | 135 | create_area: (x, y) -> |
| 136 | 136 | @area = d3.svg.area().x((d) -> |
| 137 | 137 | parseDate = d3.time.format("%Y-%m-%d").parse |
| ... | ... | @@ -148,7 +148,7 @@ class window.ContributorsAuthorGraph extends ContributorsGraph |
| 148 | 148 | .append("g") |
| 149 | 149 | .attr("transform", "translate(" + @MARGIN.left + "," + @MARGIN.top + ")") |
| 150 | 150 | draw_path: (data) -> |
| 151 | - @svg.append("path").datum(data).attr("class", "area-contributor").attr("d", @area); | |
| 151 | + @svg.append("path").datum(data).attr("class", "area-contributor").attr("d", @area) | |
| 152 | 152 | draw: -> |
| 153 | 153 | @create_scale() |
| 154 | 154 | @create_axes() | ... | ... |