|
|
|
@ -251,13 +251,16 @@ c3_axis_internal_fn.generateAxis = function () {
|
|
|
|
|
{ |
|
|
|
|
// TODO: rotated tick text
|
|
|
|
|
tickTransform = internal.axisX; |
|
|
|
|
lineUpdate.attr("x2", 0) |
|
|
|
|
.attr("y2", -internal.innerTickSize); |
|
|
|
|
lineUpdate.attr("x1", tickX) |
|
|
|
|
.attr("x2", tickX) |
|
|
|
|
.attr("y2", function (d, i) { return -1 * internal.lineY2(d, i); }); |
|
|
|
|
textUpdate.attr("x", 0) |
|
|
|
|
.attr("y", -internal.tickLength) |
|
|
|
|
.style("text-anchor", "middle"); |
|
|
|
|
.attr("y", function (d, i) { return -1 * internal.textY(d, i) - (params.isCategory ? 2 : (internal.tickLength - 2)); }) |
|
|
|
|
.attr("transform", function (d, i) { return internal.textTransform(d, i); }) |
|
|
|
|
.style("text-anchor", function (d, i) { return internal.textTextAnchor(d, i); }); |
|
|
|
|
tspanUpdate.attr('x', 0) |
|
|
|
|
.attr("dy", "0em"); |
|
|
|
|
.attr("dy", function (d, i) { return internal.tspanDy(d, i); }) |
|
|
|
|
.attr('dx', function (d, i) { return internal.tspanDx(d, i); }); |
|
|
|
|
pathUpdate.attr("d", "M" + internal.range[0] + "," + -internal.outerTickSize + "V0H" + internal.range[1] + "V" + -internal.outerTickSize); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -279,9 +282,10 @@ c3_axis_internal_fn.generateAxis = function () {
|
|
|
|
|
{ |
|
|
|
|
tickTransform = internal.axisY; |
|
|
|
|
lineUpdate.attr("x2", internal.innerTickSize) |
|
|
|
|
.attr("y2", 0); |
|
|
|
|
.attr("y1", tickY) |
|
|
|
|
.attr("y2", tickY); |
|
|
|
|
textUpdate.attr("x", internal.tickLength) |
|
|
|
|
.attr("y", 0) |
|
|
|
|
.attr("y", internal.tickOffset) |
|
|
|
|
.style("text-anchor", "start"); |
|
|
|
|
tspanUpdate.attr('x', internal.tickLength) |
|
|
|
|
.attr("dy", function (d, i) { return internal.tspanDy(d, i); }); |
|
|
|
@ -384,7 +388,7 @@ c3_axis_fn.init = function init() {
|
|
|
|
|
var $$ = this.owner, config = $$.config, main = $$.main; |
|
|
|
|
$$.axes.x = main.append("g") |
|
|
|
|
.attr("class", CLASS.axis + ' ' + CLASS.axisX) |
|
|
|
|
.attr("clip-path", $$.clipPathForXAxis) |
|
|
|
|
.attr("clip-path", config.axis_x_inner ? "" : $$.clipPathForXAxis) |
|
|
|
|
.attr("transform", $$.getTranslate('x')) |
|
|
|
|
.style("visibility", config.axis_x_show ? 'visible' : 'hidden'); |
|
|
|
|
$$.axes.x.append("text") |
|
|
|
@ -605,7 +609,7 @@ c3_axis_fn.dyForXAxisLabel = function dyForXAxisLabel() {
|
|
|
|
|
var $$ = this.owner, config = $$.config, |
|
|
|
|
position = this.getXAxisLabelPosition(); |
|
|
|
|
if (config.axis_rotated) { |
|
|
|
|
return position.isInner ? "1.2em" : -25 - this.getMaxTickWidth('x'); |
|
|
|
|
return position.isInner ? "1.2em" : -25 - ($$.config.axis_x_inner ? 0 : this.getMaxTickWidth('x')); |
|
|
|
|
} else { |
|
|
|
|
return position.isInner ? "-0.5em" : config.axis_x_height ? config.axis_x_height - 10 : "3em"; |
|
|
|
|
} |
|
|
|
|