Commit c9a664dd authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

auto fit axis text

parent a519c48c
......@@ -39,4 +39,8 @@
.ac-box-axis-left .tick line{
stroke: none;
}
.ac-box-axis .tick text {
font-size: 1.5em;
}
\ No newline at end of file
import * as d3 from 'd3';
import Chart from '../Chart';
import '../../assets/css/boxplot.css';
import textUtils from '../../utils/textwrappers';
export default class extends Chart {
constructor({ container }) {
......@@ -87,12 +88,15 @@ export default class extends Chart {
.selectAll('text')
.attr('transform', 'rotate(45)')
.attr('text-anchor', 'start')
.attr('x', 8);
.attr('x', 8)
.call(textUtils.axisShrinkFitText, margin.bottom);
this.axisRight
.attr('transform', `translate(${width}, 0)`)
.call(axisRight);
this.axisLeft
.call(axisLeft);
.call(axisLeft)
.selectAll('text')
.call(textUtils.axisShrinkFitText, margin.left);
d3.select(this.container).select('svg')
.attr('width', width + margin.left + margin.right)
......
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