Skip to content

Commit bc29c6e

Browse files
committed
Color range legend labels show min/max of color range instead of data min/max
1 parent 6c492ba commit bc29c6e

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- Parts of markers outside of plot area are getting clipped. This behaviour can
99
be controlled by style.plot.overflow parameter.
1010

11+
### Fixed
12+
13+
- Color range legend labels show min/max of color range instead of data min/max.
14+
1115
## [0.3.1] - 2021-09-24
1216

1317
### Fixed

src/chart/generator/diagram.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,20 @@ Diagram::Diagram(
8080

8181
if (gotSpecLayout)
8282
{
83-
calcAxises(dataTable);
8483
calcDiscreteAxises(dataTable);
8584
normalizeColors();
85+
calcAxises(dataTable);
8686
}
8787
else
8888
{
8989
addSeparation();
9090
normalizeXY();
91-
calcAxises(dataTable);
9291
calcDiscreteAxises(dataTable);
93-
addAlignment();
9492
normalizeSizes();
95-
recalcStackedLineChart();
9693
normalizeColors();
94+
calcAxises(dataTable);
95+
addAlignment();
96+
recalcStackedLineChart();
9797
}
9898
}
9999

@@ -455,6 +455,9 @@ void Diagram::normalizeColors()
455455
marker.color = marker.colorBuilder.render();
456456
}
457457

458+
stats.scales[ScaleId::color].range = color;
459+
stats.scales[ScaleId::lightness].range = lightness;
460+
458461
for (auto &value : discreteAxises.at(ScaleId::color))
459462
{
460463
ColorBuilder builder(style.plot.marker.lightnessRange(),

test/integration/test_cases.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@
861861
},
862862
"web_content/templates/composition_comparison_waterfall_column_2dis_1con": {
863863
"refs": [
864-
"3d8102e"
864+
"fc2c1bf"
865865
]
866866
},
867867
"web_content/templates/composition_percentage_area_stream_3dis_1con": {
@@ -999,4 +999,4 @@
999999
"f02481f"
10001000
]
10011001
}
1002-
}
1002+
}

0 commit comments

Comments
 (0)