33var extendFlat = require ( '../../lib' ) . extendFlat ;
44var scatterAttrs = require ( '../scatter/attributes' ) ;
55var axisHoverFormat = require ( '../../plots/cartesian/axis_format_attributes' ) . axisHoverFormat ;
6+ const { hovertemplateAttrs, templatefallbackAttrs } = require ( '../../plots/template_attributes' ) ;
67var dash = require ( '../../components/drawing/attributes' ) . dash ;
78var fxAttrs = require ( '../../components/fx/attributes' ) ;
89var delta = require ( '../../constants/delta.js' ) ;
@@ -15,7 +16,7 @@ var lineAttrs = scatterAttrs.line;
1516function directionAttrs ( lineColorDefault ) {
1617 return {
1718 line : {
18- color : extendFlat ( { } , lineAttrs . color , { dflt : lineColorDefault } ) ,
19+ color : extendFlat ( { } , lineAttrs . color , { dflt : lineColorDefault } ) ,
1920 width : lineAttrs . width ,
2021 dash : dash ,
2122 editType : 'style'
@@ -25,7 +26,6 @@ function directionAttrs(lineColorDefault) {
2526}
2627
2728module . exports = {
28-
2929 xperiod : scatterAttrs . xperiod ,
3030 xperiod0 : scatterAttrs . xperiod0 ,
3131 xperiodalignment : scatterAttrs . xperiodalignment ,
@@ -35,10 +35,7 @@ module.exports = {
3535 x : {
3636 valType : 'data_array' ,
3737 editType : 'calc+clearAxisTypes' ,
38- description : [
39- 'Sets the x coordinates.' ,
40- 'If absent, linear coordinate will be generated.'
41- ] . join ( ' ' )
38+ description : 'Sets the x coordinates. If absent, linear coordinate will be generated.'
4239 } ,
4340
4441 open : {
@@ -99,7 +96,7 @@ module.exports = {
9996 'If a single string, the same string appears over' ,
10097 'all the data points.' ,
10198 'If an array of string, the items are mapped in order to' ,
102- ' this trace\ 's sample points.'
99+ " this trace's sample points."
103100 ] . join ( ' ' )
104101 } ,
105102 hovertext : {
@@ -109,17 +106,20 @@ module.exports = {
109106 editType : 'calc' ,
110107 description : 'Same as `text`.'
111108 } ,
112-
109+ hovertemplate : hovertemplateAttrs (
110+ { } ,
111+ {
112+ keys : [ 'open' , 'high' , 'low' , 'close' ]
113+ }
114+ ) ,
115+ hovertemplatefallback : templatefallbackAttrs ( ) ,
113116 tickwidth : {
114117 valType : 'number' ,
115118 min : 0 ,
116119 max : 0.5 ,
117120 dflt : 0.3 ,
118121 editType : 'calc' ,
119- description : [
120- 'Sets the width of the open/close tick marks' ,
121- 'relative to the *x* minimal interval.'
122- ] . join ( ' ' )
122+ description : 'Sets the width of the open/close tick marks relative to the *x* minimal interval.'
123123 } ,
124124
125125 hoverlabel : extendFlat ( { } , fxAttrs . hoverlabel , {
@@ -128,8 +128,8 @@ module.exports = {
128128 dflt : false ,
129129 editType : 'style' ,
130130 description : [
131- 'Show hover information (open, close, high, low) in' ,
132- 'separate labels .'
131+ 'Show hover information (open, close, high, low) in separate labels, rather than a single unified label. ' ,
132+ 'Default: *false*. When set to *true*, `hovertemplate` is ignored .'
133133 ] . join ( ' ' )
134134 }
135135 } ) ,
0 commit comments