diff --git a/src/ChartInternal/internals/legend.ts b/src/ChartInternal/internals/legend.ts index 1bd689332..4e82125b0 100644 --- a/src/ChartInternal/internals/legend.ts +++ b/src/ChartInternal/internals/legend.ts @@ -617,7 +617,7 @@ export default { point = "rect"; } - return document.createElementNS(d3Namespaces.svg, $$.hasValidPointType(point) ? point : "use"); + return document.createElementNS(d3Namespaces.svg, ("hasValidPointType" in $$) && $$.hasValidPointType(point) ? point : "use"); }) .attr("class", CLASS.legendItemPoint) .style("fill", d => $$.color(d)) diff --git a/src/ChartInternal/shape/shape.ts b/src/ChartInternal/shape/shape.ts index bffc27cee..d97174e6d 100644 --- a/src/ChartInternal/shape/shape.ts +++ b/src/ChartInternal/shape/shape.ts @@ -306,7 +306,7 @@ export default { if (!$$.isTargetToShow(d.id)) { isWithin = false; - } else if ($$.hasValidPointType && $$.hasValidPointType(that.nodeName)) { + } else if (("hasValidPointType" in $$) && $$.hasValidPointType(that.nodeName)) { isWithin = $$.isStepType(d) ? $$.isWithinStep(that, $$.getYScaleById(d.id)(d.value)) : $$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0); diff --git a/test/esm/bar-spec.ts b/test/esm/bar-spec.ts index 25de44568..4560e84b2 100644 --- a/test/esm/bar-spec.ts +++ b/test/esm/bar-spec.ts @@ -8,7 +8,6 @@ import {expect} from "chai"; import sinon from "sinon"; import bb, {bar} from "../../src/index.esm"; import util from "../assets/util"; -import CLASS from "../../src/config/classes"; describe("ESM bar", function() { let chart; @@ -40,4 +39,16 @@ describe("ESM bar", function() { expect(spy.calledOnce).to.be.true; }); + + it("set options: tooltip.grouped=false", () => { + args.tooltip = { + grouped: false + }; + }); + + it("should not throw error", () => { + chart.tooltip.show({x: 1}); + + expect(true).to.be.ok; + }); }); \ No newline at end of file