Skip to content

Commit 8f8f34b

Browse files
authored
Merge pull request #582 from vizzuhq/Fix-channel-step
Fix channel step
2 parents 03d9b39 + 47469f9 commit 8f8f34b

File tree

4 files changed

+108
-1
lines changed

4 files changed

+108
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixed
66

7+
- Fix again measure axis labels when the axis range and step set too.
78
- Fix drilldown regroup strategy on fake-split charts.
89

910
## [0.13.0] - 2024-09-13

src/chart/rendering/drawinterlacing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ void DrawInterlacing::draw(
146146
auto iMin =
147147
axisBottom > 0
148148
? std::floor(-axis.origo() / (2 * stripWidth)) * 2
149-
: std::round(axis.range.getMin() - stepSize);
149+
: std::round(
150+
(axis.range.getMin() - stepSize) / stepSize);
150151

151152
auto interlaceCount = 0U;
152153
const auto maxInterlaceCount = 1000U;

test/e2e/tests/fixes.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"163": {
2020
"refs": ["a82431f"]
2121
},
22+
"252": {
23+
"refs": ["00f01d9"]
24+
},
2225
"320": {
2326
"refs": ["e4b8a2f"]
2427
},

test/e2e/tests/fixes/252.mjs

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
function time(y, m, d) {
2+
return y + (m - 1) / 12 + (d - 1) / 31 / 12
3+
}
4+
5+
const testSteps = [
6+
(chart) =>
7+
chart.animate({
8+
data: {
9+
series: [
10+
{
11+
name: 'Name',
12+
type: 'dimension',
13+
values: [
14+
'Apple Pie',
15+
'Banana Bread',
16+
'Cupcake',
17+
'Donut',
18+
'Eclair',
19+
'Froyo',
20+
'Gingerbread',
21+
'Honeycomb',
22+
'Ice Cream Sandwich',
23+
'Jelly Bean',
24+
'KitKat',
25+
'Lollipop',
26+
'Marshmallow',
27+
'Nougat',
28+
'Orea'
29+
]
30+
},
31+
{
32+
name: 'Time',
33+
type: 'measure',
34+
values: [
35+
time(2008, 9, 23),
36+
time(2009, 4, 9),
37+
time(2009, 4, 27),
38+
time(2009, 9, 15),
39+
time(2009, 10, 26),
40+
time(2010, 4, 29),
41+
time(2010, 12, 6),
42+
time(2011, 2, 22),
43+
time(2011, 10, 12),
44+
time(2012, 4, 12),
45+
time(2013, 10, 31),
46+
time(2014, 11, 3),
47+
time(2015, 10, 5),
48+
time(2016, 8, 22),
49+
time(2017, 8, 21)
50+
]
51+
},
52+
{
53+
name: 'Placement',
54+
type: 'measure',
55+
values: [1, -1, 1.5, -1.5, 1, -2, 1.5, -1.5, 1, -1, 1, -1, 1, -1, 1]
56+
}
57+
]
58+
}
59+
}),
60+
(chart) =>
61+
chart.animate({
62+
config: {
63+
x: {
64+
set: 'Time',
65+
range: { min: 2008.5, max: 2018.1 },
66+
step: 1,
67+
ticks: true,
68+
title: null
69+
},
70+
y: {
71+
set: 'Placement',
72+
interlacing: false,
73+
labels: false,
74+
markerGuides: false,
75+
title: null
76+
},
77+
label: 'Name',
78+
geometry: 'circle'
79+
},
80+
style: {
81+
plot: {
82+
xAxis: {
83+
label: {
84+
numberFormat: 'none',
85+
position: 'axis'
86+
}
87+
},
88+
marker: {
89+
guides: {
90+
color: '#666666'
91+
}
92+
}
93+
}
94+
}
95+
}),
96+
(chart) =>
97+
chart.animate({
98+
x: { step: 2 }
99+
})
100+
]
101+
102+
export default testSteps

0 commit comments

Comments
 (0)