Browse Source

Modify tickTextNum for category axis

pull/1/head
Masayuki Tanaka 12 years ago committed by masayuki
parent
commit
90208eb144
  1. 7
      c3.js

7
c3.js

@ -1606,7 +1606,7 @@
} }
function categoryAxis () { function categoryAxis () {
var scale = d3.scale.linear(), orient = "bottom", tickMajorSize = 6, tickMinorSize = 6, tickEndSize = 6, tickPadding = 3, tickCentered = false, tickTextNum = 30, tickOffset = 0, categories = [] var scale = d3.scale.linear(), orient = "bottom", tickMajorSize = 6, tickMinorSize = 6, tickEndSize = 6, tickPadding = 3, tickCentered = false, tickTextNum = 10, tickOffset = 0, categories = []
function axisX (selection, x) { function axisX (selection, x) {
selection.attr("transform", function(d){ selection.attr("transform", function(d){
return "translate(" + (x(d) + tickOffset) + ",0)" return "translate(" + (x(d) + tickOffset) + ",0)"
@ -1737,6 +1737,11 @@
tickCentered = x tickCentered = x
return axis return axis
} }
axis.tickTextNum = function(x) {
if (!arguments.length) return tickTextNum
tickTextNum = x
return axis
}
axis.tickOffset = function() { axis.tickOffset = function() {
return tickOffset return tickOffset
} }

Loading…
Cancel
Save