Skip to content

Commit 7f2604a

Browse files
committed
use extractOption in choropleth hover
1 parent 2fe641d commit 7f2604a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/traces/choropleth/hover.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
'use strict';
1111

12+
var Lib = require('../../lib');
1213
var Axes = require('../../plots/cartesian/axes');
1314
var attributes = require('./attributes');
1415

@@ -80,12 +81,8 @@ function makeHoverInfo(pointData, trace, pt, axis) {
8081

8182
if(hasZ) text.push(formatter(pt.z));
8283
if(hasText) {
83-
var tx;
84-
85-
if(pt.tx) tx = pt.tx;
86-
else if(trace.text) tx = trace.text;
87-
88-
if(!Array.isArray(tx)) text.push(tx);
84+
var tx = Lib.extractOption(pt, trace, 'tx', 'text');
85+
if(tx && tx !== '') text.push(tx);
8986
}
9087

9188
pointData.extraText = text.join('<br>');

0 commit comments

Comments
 (0)