Fix 'Uncaught TypeError: pe.clamp is not a function' (#4901)

This commit is contained in:
Maxime Beauchemin 2018-04-27 16:15:43 -07:00 committed by GitHub
parent 0a953714ac
commit caa72675a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -602,7 +602,9 @@ export default function nvd3Vis(slice, payload) {
xMax = chart.xAxis.scale().domain()[1].valueOf();
xScale = chart.xScale ? chart.xScale() : d3.scale.linear();
}
xScale.clamp(true);
if (xScale && xScale.clamp) {
xScale.clamp(true);
}
if (Array.isArray(formulas) && formulas.length) {
const xValues = [];