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
abe3e3cc
Commit
abe3e3cc
authored
Mar 21, 2019
by
Sascha Herzinger
Browse files
fixed legend enter bug
parent
13dc85a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/charts/impl/Barplot.js
View file @
abe3e3cc
...
...
@@ -193,9 +193,23 @@ export default class extends Chart {
.
data
(
groups
);
const
selectedGroups
=
[];
const
legendEnter
=
legend
.
enter
()
legend
.
enter
()
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
'
ac-bar-legend-element
'
)
.
call
((
parent
)
=>
{
parent
.
append
(
'
rect
'
)
.
attr
(
'
width
'
,
legendElementSize
)
.
attr
(
'
height
'
,
legendElementSize
)
.
attr
(
'
fill
'
,
color
);
parent
.
append
(
'
text
'
)
.
attr
(
'
text-anchor
'
,
'
start
'
)
.
style
(
'
dominant-baseline
'
,
'
central
'
)
.
attr
(
'
transform
'
,
`translate(
${
legendElementSize
+
2
}
,
${
legendElementSize
/
2
}
)`
)
.
text
(
d
=>
d
);
})
.
merge
(
legend
)
.
attr
(
'
transform
'
,
(
d
,
i
)
=>
`translate(
${
width
+
legendElementSize
}
,
${(
legendElementSize
+
legendElementSize
/
2
)
*
i
}
)`
)
.
on
(
'
click
'
,
(
group
)
=>
{
...
...
@@ -223,18 +237,5 @@ export default class extends Chart {
legend
.
exit
()
.
remove
();
legendEnter
.
append
(
'
rect
'
)
.
attr
(
'
width
'
,
legendElementSize
)
.
attr
(
'
height
'
,
legendElementSize
)
.
attr
(
'
fill
'
,
color
);
legendEnter
.
append
(
'
text
'
)
.
attr
(
'
text-anchor
'
,
'
start
'
)
.
style
(
'
dominant-baseline
'
,
'
central
'
)
.
attr
(
'
transform
'
,
`translate(
${
legendElementSize
+
2
}
,
${
legendElementSize
/
2
}
)`
)
.
text
(
d
=>
d
);
}
}
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