Browse Source

add support for array of tick label strings #139

formatted tick label can be an array of strings, each will be displayed
in a line
pull/676/head
DungSaga 10 years ago
parent
commit
f05f765cb1
  1. 2
      c3.js
  2. 2
      c3.min.js
  3. 2
      src/c3.axis.js

2
c3.js

@ -6456,7 +6456,7 @@
text = tick.select("text");
tspan = text.selectAll('tspan')
.data(function (d, i) {
var splitted = params.tickWidth ? splitTickText(d) : [textFormatted(d)];
var splitted = params.tickWidth ? splitTickText(d) : [].concat(textFormatted(d));
counts[i] = splitted.length;
return splitted.map(function (s) {
return { index: i, splitted: s };

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/c3.axis.js

@ -149,7 +149,7 @@ function c3_axis(d3, params) {
text = tick.select("text");
tspan = text.selectAll('tspan')
.data(function (d, i) {
var splitted = params.tickWidth ? splitTickText(d) : [textFormatted(d)];
var splitted = params.tickWidth ? splitTickText(d) : [].concat(textFormatted(d));
counts[i] = splitted.length;
return splitted.map(function (s) {
return { index: i, splitted: s };

Loading…
Cancel
Save