Commit 9b94ff35 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

#9 barplot: fix text cutoff at far left/right

parent 2942785a
......@@ -13,6 +13,10 @@
cursor: pointer;
}
.ac-bar-legend-element text {
font-size: 0.8em;
}
.ac-bar-axis path {
stroke: #d6d6d6;
stroke-width: 1px;
......
......@@ -36,11 +36,11 @@ export default class extends Chart {
}
render({
title,
categories,
series,
barClickCallback,
}) {
title,
categories,
series,
barClickCallback,
}) {
const groups = series.map(d => d.name);
const data = [];
series.forEach((d) => {
......@@ -221,6 +221,9 @@ export default class extends Chart {
.text(d => d);
})
.merge(legend)
.each((_, i, arr) => {
textUtils.sliceFitText(d3.select(arr[i]).select('text').node(), margin.right - 2 * legendElementSize - 4);
})
.attr('transform', (d, i) => `translate(${width + legendElementSize}, ${(legendElementSize + legendElementSize / 2) * i})`)
.on('click', (group) => {
const idx = selectedGroups.indexOf(group);
......
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