Skip to content

Commit d727a1c

Browse files
committed
fixed histogram2dcontour attributes
1 parent 5884f4f commit d727a1c

File tree

3 files changed

+66
-5
lines changed

3 files changed

+66
-5
lines changed

src/traces/histogram2dcontour/attributes.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ module.exports = extendFlat({
4545
hovertemplate: histogram2dAttrs.hovertemplate,
4646
texttemplate: contourAttrs.texttemplate,
4747
textfont: contourAttrs.textfont,
48-
tooltip: {
49-
type: 'object',
50-
description: 'Accepts any properties typically used in annotations. This flexible structure allows for customization according to specific needs.',
51-
editType: 'plot'
52-
},
48+
tooltip: histogram2dAttrs.tooltip,
5349
tooltiptemplate: histogram2dAttrs.tooltiptemplate
5450
},
5551
colorScaleAttrs('', {

src/traces/histogram2dcontour/defaults.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
2626
coerce('xhoverformat');
2727
coerce('yhoverformat');
2828
coerce('hovertemplate');
29+
30+
coerce('tooltip');
31+
coerce('tooltiptemplate');
2932
if(
3033
traceOut.contours &&
3134
traceOut.contours.coloring === 'heatmap'
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"data": [
3+
{
4+
"showlegend": true,
5+
"coloraxis": "coloraxis",
6+
"x": [
7+
"apples",
8+
"apples",
9+
"apples",
10+
"apples",
11+
"lemons",
12+
"lemons"
13+
],
14+
"y": [
15+
"red",
16+
"red",
17+
"yellow",
18+
"green",
19+
"yellow",
20+
"yellow"
21+
],
22+
"z": [
23+
"1",
24+
"2",
25+
"3",
26+
"4",
27+
"5",
28+
"6"
29+
],
30+
"histfunc": "sum",
31+
"type": "histogram2dcontour",
32+
"name": "histogram2dcontour",
33+
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}<br>z: %{z}",
34+
"tooltip": {"bgcolor":"rgba(255, 255, 255, 0.2)"}
35+
}
36+
],
37+
"layout": {
38+
"coloraxis": {
39+
"colorscale": [[0, "blue"], [1, "red"]],
40+
"reversescale": true,
41+
"showscale": false
42+
},
43+
"title": {"text": "<i>histogram2dcontour</i> legend with <b>coloraxis</b>"},
44+
"margin": {
45+
"t": 125,
46+
"b": 25
47+
},
48+
"width": 600,
49+
"height": 400
50+
},
51+
"config": {
52+
"editable": true,
53+
"modeBarButtonsToAdd": [
54+
"tooltip",
55+
"hoverclosest",
56+
"hovercompare",
57+
"togglespikelines"
58+
],
59+
"displaylogo": false,
60+
"displayModeBar": true
61+
}
62+
}

0 commit comments

Comments
 (0)