plugins/incub/benchmark/src/main/resources/static/c3.js
function splitTickText(d, maxWidth) {
                    var tickText = textFormatted(d),
                        subtext, spaceIndex, textWidth, splitted = [];

                    if (Object.prototype.toString.call(tickText) === "[object Array]") {
                        return tickText;
                    }

                    if (!maxWidth || maxWidth <= 0) {
                        maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;
                    }

                    function split(splitted, text) {
                        spaceIndex = undefined;
                        for (var i = 1; i < text.length; i++) {
                            if (text.charAt(i) === ' ') {
                                spaceIndex = i;
                            }
                            subtext = text.substr(0, i + 1);
                            textWidth = sizeFor1Char.w * subtext.length;
                            // if text width gets over tick width, split by space index or crrent index
                            if (maxWidth < textWidth) {
                                return split(
                                    splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),
                                    text.slice(spaceIndex ? spaceIndex + 1 : i)
                                );
                            }
                        }
                        return splitted.concat(text);
                    }

                    return split(splitted, tickText + "");
                }
function splitTickText(d, maxWidth) {
                    var tickText = textFormatted(d),
                        subtext, spaceIndex, textWidth, splitted = [];

                    if (Object.prototype.toString.call(tickText) === "[object Array]") {
                        return tickText;
                    }

                    if (!maxWidth || maxWidth <= 0) {
                        maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;
                    }

                    function split(splitted, text) {
                        spaceIndex = undefined;
                        for (var i = 1; i < text.length; i++) {
                            if (text.charAt(i) === ' ') {
                                spaceIndex = i;
                            }
                            subtext = text.substr(0, i + 1);
                            textWidth = sizeFor1Char.w * subtext.length;
                            // if text width gets over tick width, split by space index or crrent index
                            if (maxWidth < textWidth) {
                                return split(
                                    splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),
                                    text.slice(spaceIndex ? spaceIndex + 1 : i)
                                );
                            }
                        }
                        return splitted.concat(text);
                    }

                    return split(splitted, tickText + "");
                }
function splitTickText ( d , maxWidth ) { var tickText = textFormatted ( d ) , subtext , spaceIndex , textWidth , splitted = [ ] ; if ( Object . prototype . toString . call ( tickText ) === "[object Array]" ) { return tickText ; } if ( ! maxWidth || maxWidth <= 0 ) { maxWidth = isVertical ? 95 : params . isCategory ? ( Math . ceil ( scale1 ( ticks [ 1 ] ) - scale1 ( ticks [ 0 ] ) ) - 12 ) : 110 ; } function split ( splitted , text ) { spaceIndex = undefined ; for ( var i = 1 ; i < text . length ; i ++ ) { if ( text . charAt ( i ) === ' ' ) { spaceIndex = i ; } subtext = text . substr ( 0 , i + 1 ) ; textWidth = sizeFor1Char . w * subtext . length ; // if text width gets over tick width, split by space index or crrent index if ( maxWidth < textWidth ) { return split ( splitted . concat ( text . substr ( 0 , spaceIndex ? spaceIndex : i ) ) , text . slice ( spaceIndex ? spaceIndex + 1 : i ) ) ; } } return splitted . concat ( text ) ; } return split ( splitted , tickText + "" ) ; }
this should be called only when category axis
this should be called only when category axis