Skip to content

Commit 38bd7ca

Browse files
authored
Merge pull request #1500 from plotly/histogram-colorscale
Bring back histogram colorscale
2 parents 9ca589a + 9a07ce1 commit 38bd7ca

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/traces/histogram/calc.js

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var isNumeric = require('fast-isnumeric');
1414
var Lib = require('../../lib');
1515
var Axes = require('../../plots/cartesian/axes');
1616

17+
var arraysToCalcdata = require('../bar/arrays_to_calcdata');
1718
var binFunctions = require('./bin_functions');
1819
var normFunctions = require('./norm_functions');
1920
var doAvg = require('./average');
@@ -168,6 +169,8 @@ module.exports = function calc(gd, trace) {
168169
}
169170
}
170171

172+
arraysToCalcdata(cd, trace);
173+
171174
return cd;
172175
};
173176

14.9 KB
Loading
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"data": [
3+
{
4+
"xbins": {
5+
"start": -1.5,
6+
"end": 4.5,
7+
"size": 1
8+
},
9+
"marker": {
10+
"cmin": 0,
11+
"colorscale": "Earth",
12+
"color": [ 0, 1, 2, 3, 4, 5 ],
13+
"cmax": 5
14+
},
15+
"x": [ 0, 1, 1, 2, 2, 2, 3, 3, 4 ],
16+
"type": "histogram"
17+
}
18+
],
19+
"layout": {
20+
"height": 500,
21+
"width": 700
22+
}
23+
}

0 commit comments

Comments
 (0)