Skip to content

Commit b139c07

Browse files
committed
fixed scatter attributes
1 parent c04ae71 commit b139c07

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/traces/scatter/attributes.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,12 @@ module.exports = {
688688
arrayOk: true,
689689
description: 'Sets the text font.'
690690
}),
691-
tooltip: {
692-
type: 'object',
691+
tooltip: {annotationAttrs,
692+
valType: 'any',
693693
description: 'Accepts any properties typically used in annotations. This flexible structure allows for customization according to specific needs.',
694-
editType: 'plot'
694+
editType: 'calc'
695695
},
696-
tooltiptemplate: tooltiptemplateAttrs({}, {
697-
keys: constants.eventDataKeys
698-
}),
696+
tooltiptemplate: extendFlat({}, tooltiptemplateAttrs(), {dflt: 'x: %{x:.4~g}<br>y: %{y:.4~g}'}),
699697
zorder: {
700698
valType: 'integer',
701699
dflt: 0,

src/traces/scatter/defaults.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
4646
coerce('hovertext');
4747
coerce('mode', defaultMode);
4848

49+
coerce('tooltip');
50+
coerce('tooltiptemplate');
51+
4952
if(subTypes.hasMarkers(traceOut)) {
5053
handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});
5154
}

0 commit comments

Comments
 (0)