Skip to content

Commit

Permalink
Fixing x-axis chart bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hudson committed Apr 3, 2013
1 parent 35ccb7f commit dff094e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sixpack/static/js/chart.js
Expand Up @@ -58,6 +58,8 @@ $(function () {

if (xValues.length > 10) {
my.xAxis.ticks(d3.time.days, 4)
} else if (xValues.length === 2) {
my.xAxis.ticks(d3.time.days, 1)
} else {
my.xAxis.ticks(xValues.length)
}
Expand Down Expand Up @@ -159,12 +161,10 @@ $(function () {
my.svg.append("g")
.attr("class", "grid")
.attr("transform", "translate(0," + (my.height) + ")")
.call(d3.svg.axis()
.scale(my.xScale)
.orient("bottom")
.ticks(data.length)
.tickSize(-my.height, 0, 0)
.tickFormat(""));
.call(my.xAxis
.ticks(d3.time.days, 1)
.tickSize(-my.height, 0, 0)
.tickFormat(""));
};

my.dataExists = function (data) {
Expand Down

0 comments on commit dff094e

Please sign in to comment.