Skip to content

Commit 40e8c6a

Browse files
committed
Adding fix for issue 6661
1 parent ab114f8 commit 40e8c6a

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

src/traces/histogram/calc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ function calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {
309309
// Edge case: single-valued histogram overlaying others
310310
// Use them all together to calculate the bin size for the single-valued one
311311
if(isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 &&
312-
pa.type !== 'category' && pa.type !== 'multicategory') {
312+
pa.type !== 'category' && pa.type !== 'multicategory' &&
313+
trace.bingroup !== '' && (typeof trace.xbins !== 'undefined')) {
313314
// Several single-valued histograms! Stop infinite recursion,
314315
// just return an extra flag that tells handleSingleValueOverlays
315316
// to sort out this trace too
21.3 KB
Loading
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"data": [
3+
{
4+
"x": ["2023-05-22 09:29:56.00"],
5+
"opacity": 1,
6+
"type": "histogram",
7+
"name": "Results B",
8+
"marker": {
9+
"color": "rgba(0, 255, 0, .2)",
10+
"line": {
11+
"color": "rgba(0, 255, 0, 1)",
12+
"width": 2
13+
}
14+
},
15+
"xbins": {
16+
"size": "M1",
17+
"start": "2023-05-01",
18+
"end": "2023-07-01"
19+
}
20+
},
21+
{
22+
"x": ["2023-05-21 09:29:56.00", "2023-05-26 09:29:56.00", "2023-06-21 09:29:56.00"],
23+
"opacity": 1,
24+
"type": "histogram",
25+
"name": "Results A",
26+
"marker": {
27+
"color": "rgba(0, 0, 255, .2)",
28+
"line": {
29+
"color": "rgba(0, 0, 255, 1)",
30+
"width": 2
31+
}
32+
},
33+
"xbins": {
34+
"size": "M1",
35+
"start": "2023-05-01",
36+
"end": "2023-07-01"
37+
}
38+
}
39+
],
40+
"layout": {
41+
"barmode": "overlay",
42+
"title": "Sampled Results",
43+
"xaxis": {
44+
"title": "Date"
45+
},
46+
"yaxis": { "title": "Count" }
47+
}
48+
}

0 commit comments

Comments
 (0)