Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 480 #484

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
were not escaped properly.
- Fix dimension label transition on axis and legend.
- Through event handler call, when a new event handler is registered, undefined behaviour happened.
- Fix invisible legend when there is no data on that channel.

### Added

Expand Down
11 changes: 7 additions & 4 deletions src/chart/options/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ uint64_t Options::generateMarkerInfoId()

void Options::setAutoParameters()
{
if (legend.get().isAuto()) {
LegendType tmp = legend.get();
tmp.setAuto(getAutoLegend());
legend = tmp;
if (auto [leg, w] = legend.get(0); leg.isAuto()) {
schaumb marked this conversation as resolved.
Show resolved Hide resolved
leg.setAuto(getAutoLegend());
legend = leg;
}
else if (w > 0 && leg
&& getChannels().at(toChannel(*leg)).isEmpty()) {
legend = LegendType{};
}
if (orientation.get().isAuto()) {
auto tmp = orientation.get();
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test_cases/test_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@
"refs": ["738524b"]
},
"ww_next_steps/next_steps_byOperations/remove/remove_05": {
"refs": ["d283ab6"]
"refs": ["dc39db9"]
},
"ww_next_steps/next_steps_byOperations/remove/remove_07": {
"refs": ["1f89123"]
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/tests/fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"450": {
"refs": ["761380e"]
},
"480": {
"refs": ["fc46121"]
},
"32303048": {
"refs": ["b5d95ea"]
},
Expand Down
30 changes: 30 additions & 0 deletions test/e2e/tests/fixes/480.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const testSteps = [
(chart) => {
const data = {
series: [
{ name: 'Foo', values: ['a', 'b', 'c', 'a', 'b', 'c'] },
{ name: 'Foo2', values: ['A', 'A', 'A', 'B', 'B', 'B'] },
{ name: 'Bar', values: [150000000, 32, 12, 3, 2, 10], unit: 'p' }
]
}
return chart.animate({ data })
},
(chart) =>
chart.animate({
config: {
size: 'count()',
label: 'count()',
geometry: 'circle',
title: 'Pre title'
}
}),
(chart) =>
chart.animate({
config: {
legend: 'color',
title: 'Some change'
}
})
]

export default testSteps