Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sascha Herzinger
AdaCharts
Commits
9b94ff35
Commit
9b94ff35
authored
Mar 21, 2019
by
Sascha Herzinger
Browse files
#9
barplot: fix text cutoff at far left/right
parent
2942785a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/assets/css/barplot.css
View file @
9b94ff35
...
...
@@ -13,6 +13,10 @@
cursor
:
pointer
;
}
.ac-bar-legend-element
text
{
font-size
:
0.8em
;
}
.ac-bar-axis
path
{
stroke
:
#d6d6d6
;
stroke-width
:
1px
;
...
...
src/charts/impl/Barplot.js
View file @
9b94ff35
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment