Skip to content

Commit a0ce2d0

Browse files
authored
Merge pull request #2272 from visualize-admin/feat/show-values-improvements
feat: Show values improvements
2 parents 424c59c + a993dff commit a0ce2d0

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ You can also check the
1818
- Dimension unit labels are now fetched not only in English language, but
1919
others too – and we fall back to a regular string in case the label is not
2020
localized
21+
- Value labels in segmented bar charts are now centered horizontally
2122
- It's now possible to enter www links in text blocks link elements, instead
2223
of having to always use https://
2324
- Fixes

app/charts/bar/rendering-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export const renderBars = (
7272
.style("height", "100%")
7373
.append("xhtml:p")
7474
.call(setSegmentValueLabelStyles)
75-
.style("padding-left", "4px")
75+
.style("padding-left", "2px")
76+
.style("padding-right", "2px")
7677
.style("color", function (d) {
7778
return d.valueLabelColor ?? select(this).style("color");
7879
})

app/charts/column/rendering-utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export const renderColumns = (
6464
.append("xhtml:p")
6565
.call(setSegmentValueLabelStyles)
6666
.style("padding-top", "4px")
67+
.style("padding-left", "2px")
68+
.style("padding-right", "2px")
6769
.style("color", function (d) {
6870
return d.valueLabelColor ?? select(this).style("color");
6971
})

app/charts/shared/render-value-labels.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export const setSegmentValueLabelStyles = <
123123
) => {
124124
return g
125125
.style("overflow", "hidden")
126+
.style("width", "100%")
126127
.style("margin", 0)
127128
.style("text-align", "center")
128129
.style("font-size", "12px")

app/configurator/components/filters.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ const MultiFilterContent = ({
445445
<Divider sx={{ mt: 4 }} />
446446
</Box>
447447
{enableSettingShowValuesBySegment ? (
448-
<Flex justifyContent="flex-end" gap={2}>
448+
<Flex gap={2} alignItems="center" sx={{ color: "primary.main" }}>
449449
<Button
450450
variant="text"
451451
color="blue"
@@ -467,6 +467,7 @@ const MultiFilterContent = ({
467467
>
468468
<Trans id="controls.filter.show-values.all">Show all values</Trans>
469469
</Button>
470+
470471
<Button
471472
variant="text"
472473
color="blue"

0 commit comments

Comments
 (0)