Use translate instead of dx for compatibility with Batik

parent c94bf341
...@@ -323,11 +323,13 @@ c3_chart_internal_fn.rotateTickText = function (axis, transition, rotate) { ...@@ -323,11 +323,13 @@ c3_chart_internal_fn.rotateTickText = function (axis, transition, rotate) {
return 'middle'; return 'middle';
} }
}); });
// Here we use translate for <text> instead of dx for <tspan>
// because Batik rasterizer ignores dx attribute
var yOffset = -this.xForRotatedTickText(rotate);
transition.selectAll('.tick text') transition.selectAll('.tick text')
.attr("y", this.yForRotatedTickText(rotate)) .attr("y", this.yForRotatedTickText(rotate))
.attr("transform", "rotate(" + rotate + ")") .attr("transform", "translate(0 "+ yOffset +") rotate(" + rotate + ")");
.selectAll('tspan')
.attr('dx', this.xForRotatedTickText(rotate));
}; };
c3_chart_internal_fn.getMaxTickWidth = function (id) { c3_chart_internal_fn.getMaxTickWidth = function (id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment