diff --git a/js/modules/debugger.src.js b/js/modules/debugger.src.js index cae341b86f4..e4436c02f23 100644 --- a/js/modules/debugger.src.js +++ b/js/modules/debugger.src.js @@ -41,7 +41,7 @@ addEvent(H.Chart, 'displayError', function (e) { } }); } - if (options && options.displayErrors) { + if (options && options.displayErrors && renderer) { chart.errorElements = []; msg = isNumber(code) ? ('Highcharts error #' + code + ': ' + diff --git a/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.html b/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.html deleted file mode 100644 index c75d0d6b7ba..00000000000 --- a/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -
-
- -
-
\ No newline at end of file diff --git a/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.js b/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.js deleted file mode 100644 index b2ceeedc368..00000000000 --- a/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.js +++ /dev/null @@ -1,64 +0,0 @@ -QUnit.test('Slice color after drilldown and select.', function (assert) { - var options = { - chart: { - type: 'pie', - options3d: { - alpha: 45, - beta: 0 - } - }, - plotOptions: { - pie: { - depth: 35, - allowPointSelect: true, - colors: ['#00e500', '#004400'] - } - - }, - series: [{ - name: "Materials", - data: [{ - y: 23.73 - }, { - y: 76.27, - drilldown: "Recycled Materials" - }] - }], - drilldown: { - series: [{ - animation: false, - id: "Recycled Materials", - data: [ - ["Tent Frames and Chairs - 6,400 lbs", 4.35], - ["Aluminum Cans - 28,950 lbs", 19.66], - ["Plastic PET Bottles - 36,420 lbs", 24.73], - ["Glass - 40,950 lbs", 27.8], - ["Cardboard - 30,000 lbs", 20.37], - ["Solo Cups - 4,556 lbs", 3.09]] - }] - } - }, - chart, chart3d; - - chart = $('#container').highcharts(options).highcharts(); - options.chart.options3d.enabled = true; - chart3d = $('#container_2').highcharts(options).highcharts(); - - chart.series[0].points[1].doDrilldown(); - chart.series[0].points[0].select(); - - chart3d.series[0].points[1].doDrilldown(); - chart3d.series[0].points[0].select(); - - assert.strictEqual( - chart.series[0].points[0].graphic.attr("fill"), - chart.series[0].options.colors[0], - 'Proper select-state color' - ); - - assert.strictEqual( - chart3d.series[0].points[0].graphic.top.attr("fill"), - chart3d.series[0].options.colors[0], - 'Proper select-state color' - ); -}); \ No newline at end of file diff --git a/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.html b/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.html deleted file mode 100644 index a8f433b5f6d..00000000000 --- a/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -
-
- -
- -
- -
- -
diff --git a/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.html b/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.html deleted file mode 100644 index 778748b5d9a..00000000000 --- a/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
- -
-
-
\ No newline at end of file diff --git a/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.js b/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.js deleted file mode 100644 index caa0290fbe1..00000000000 --- a/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.js +++ /dev/null @@ -1,36 +0,0 @@ -QUnit.test("Change of label alignment after add", function (assert) { - var ren = new Highcharts.Renderer( - document.getElementById('container'), - 500, - 300 - ); - - var lbl = ren.label('Hello World', 100, 100) - .attr({ - //align: 'right', - fill: 'silver' - }) - .add(); - - - var g = ren.box.querySelector('g'); - - - assert.close( - g.getBoundingClientRect().left, - 100, - 1, // +/- 0.5px in Edge - "Box is left aligned" - ); - - - lbl.attr({ align: 'right' }); - - assert.close( - g.getBoundingClientRect().right, - 100, - 1, // +/- 0.5px in Edge - "Box is right aligned" - ); - -}); diff --git a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.details b/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.details deleted file mode 100644 index 00135abb1ad..00000000000 --- a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.details +++ /dev/null @@ -1,5 +0,0 @@ ---- - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.details b/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.details deleted file mode 100644 index 00135abb1ad..00000000000 --- a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.details +++ /dev/null @@ -1,5 +0,0 @@ ---- - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.html b/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.html deleted file mode 100644 index 8a1c3df7e46..00000000000 --- a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.html +++ /dev/null @@ -1,45 +0,0 @@ - - - -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JaneJohn
Apples-3,4-4,24
Pears-1,2-1,5
Plums5,111,1
Bananas-1,1-1,1
Oranges-3,12-2,9
\ No newline at end of file diff --git a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.js b/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.js deleted file mode 100644 index 35a86dd75ce..00000000000 --- a/samples/issues/highcharts-4.1.9/4749-data-decimalpoint-negative/demo.js +++ /dev/null @@ -1,28 +0,0 @@ -$(function () { - QUnit.test("Data module with decimapPoint and negative numbers", function (assert) { - var chart = $("#container").highcharts({ - data: { - table: 'datatable', - decimalPoint: ',' - }, - chart: { - type: 'column' - } - }).highcharts(); - - assert.equal( - chart.series[0].points.map(function (point) { - return point.y; - }).join(','), - '-3.4,-1.2,5.1,-1.1,-3.12', - 'Series 1 correct data' - ); - assert.equal( - chart.series[1].points.map(function (point) { - return point.y; - }).join(','), - '-4.24,-1.5,11.1,-1.1,-2.9', - 'Series 2 correct data' - ); - }); -}); \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.details b/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.details deleted file mode 100644 index 2e236bf83d2..00000000000 --- a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.details +++ /dev/null @@ -1,7 +0,0 @@ ---- - authors: - - Jon Arild Nygård - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.html b/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.html deleted file mode 100644 index 070df18405a..00000000000 --- a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.html +++ /dev/null @@ -1,10 +0,0 @@ - - -
-
- -
-
-
-
-
diff --git a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.js b/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.js deleted file mode 100644 index ba6781ed511..00000000000 --- a/samples/issues/highcharts-4.2.1/4906-pointer-hoverchartindex-mouseisdown/demo.js +++ /dev/null @@ -1,95 +0,0 @@ -$(function () { - QUnit.test('Do not change hoverChartIndex during a drag.', function (assert) { - var chart1, - chart2, - offset1, - offset2, - y, - start, - end; - - chart1 = Highcharts.chart('container1', { - chart: { - zoomType: 'x' - }, - series: [{ - data: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] - }], - title: { - text: 'Chart1' - } - }); - chart2 = Highcharts.chart('container2', { - chart: { - zoomType: 'x' - }, - series: [{ - data: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] - }], - title: { - text: 'Chart2' - } - }); - - Highcharts.each(chart1.axes, function (axis) { - if (axis.isXAxis) { - assert.strictEqual( - typeof axis.userMin, - 'undefined', - 'Chart1 has not zoomed' - ); - } - }); - Highcharts.each(chart2.axes, function (axis) { - if (axis.isXAxis) { - assert.strictEqual( - typeof axis.userMin, - 'undefined', - 'Chart2 has not zoomed' - ); - } - }); - - offset1 = Highcharts.offset(chart1.container); - offset2 = Highcharts.offset(chart2.container); - start = offset1.left + chart1.plotLeft + (chart1.plotSizeX / 2); - end = offset2.left + chart2.plotLeft + (chart2.plotSizeX / 2); - y = offset1.top + chart1.plotTop + (chart1.plotSizeY / 2); - // Do a drag and drop - chart1.pointer.onContainerMouseDown({ - type: 'mousedown', - pageX: start, - pageY: y - }); - chart1.pointer.onContainerMouseMove({ - type: 'mousemove', - pageX: end, - pageY: y - }); - chart1.pointer.onDocumentMouseUp({ - type: 'mouseup', - pageX: end, - pageY: y - }); - - // Test after interaction - Highcharts.each(chart1.axes, function (axis) { - if (axis.isXAxis) { - assert.strictEqual( - typeof axis.userMin, - 'number', - 'Chart1 has zoomed' - ); - } - }); - Highcharts.each(chart2.axes, function (axis) { - if (axis.isXAxis) { - assert.strictEqual( - typeof axis.userMin, - 'undefined', - 'Chart2 has still not zoomed' - ); - } - }); - }); -}); \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.details b/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.details deleted file mode 100644 index 2e236bf83d2..00000000000 --- a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.details +++ /dev/null @@ -1,7 +0,0 @@ ---- - authors: - - Jon Arild Nygård - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.js b/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.js deleted file mode 100644 index 9b983588dc7..00000000000 --- a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.js +++ /dev/null @@ -1,30 +0,0 @@ -$(function () { - QUnit.test('SplineSeries.getPointSpline', function (assert) { - var getPointSpline = Highcharts.seriesTypes.spline.prototype.getPointSpline, - segment = [{ - plotX: -5, - plotY: 10 - }, { - plotX: 240, - plotY: 250 - }, { - plotX: 510, - plotY: 0 - }]; - - function pathToString(arr) { - return arr.join(' '); - } - - assert.strictEqual( - pathToString(getPointSpline(segment, segment[1], 1)), - pathToString(['C', -5, 10, 142, 250, 240, 250]), - 'Path to point.1 is correct' - ); - assert.strictEqual( - pathToString(getPointSpline(segment, segment[2], 2)), - pathToString(['C', 348, 250, 510, 0, 510, 0]), - 'Path to point.2 is correct' - ); - }); -}); \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.details b/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.details deleted file mode 100644 index 2e236bf83d2..00000000000 --- a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.details +++ /dev/null @@ -1,7 +0,0 @@ ---- - authors: - - Jon Arild Nygård - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.html b/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.html deleted file mode 100644 index a9e04ed4179..00000000000 --- a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.html +++ /dev/null @@ -1,8 +0,0 @@ - - -
-
- - -
-
diff --git a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.js b/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.js deleted file mode 100644 index bdf68820b20..00000000000 --- a/samples/issues/highcharts-4.2.3/4751-treemap-inconsistent-behaviour-after-resize/demo.js +++ /dev/null @@ -1,115 +0,0 @@ -jQuery(function () { - var defaultOptions = { - chart: { - type: 'treemap', - spacing: 0 - }, - plotOptions: { - treemap: { - shadow: null, - layoutAlgorithm: 'squarified', - datalabels: { - crop: false - } - } - }, - credits: false, - series: [{ - data: [{ - id: 'A', - name: 'Ana are mere si peremgfdjgj fddifjhdfi oidgjhodgj dtjhod kngfjgiodfjhoi fofijhofo hjohjod ogfjho jgfk f hgf hfg', - value: 6, - color: 'red' - }, { - id: 'B', - name: 'Ana are mere si peremgfdjgj fddifjhdfi oidgjhodgj dtjhod kngfjgiodfjhoi fofijhofo hjohjod ogfjho jgfk f hgf hfg', - value: 6, - color: 'blue' - }, { - id: 'C', - name: 'Ana are mere si castraveti', - value: 4, - color: 'green' - }] - }], - title: { - text: null - } - }, - // Create chart1 with width calculated from the container and default height of 400px - chart1 = Highcharts.chart('container-1', defaultOptions), - // Create chart2 with width of 470px and height of 400px - chart2 = Highcharts.chart('container-2', (function () { - defaultOptions.chart.width = 470; - defaultOptions.chart.height = 400; - return defaultOptions; - }())); - - // Update chart1 with the same height and width as chart2 - chart1.setSize(470, 400, false); - // Run test - QUnit.test('Chart behave equally on a resize as with a first render', function (assert) { - // Check if height, left, right and width is equal - ['chartHeight', 'chartWidth', 'plotHeight', 'plotLeft', 'plotSizeX', 'plotSizeX', 'plotTop', 'plotWidth'].forEach(function (prop) { - assert.strictEqual( - chart1[prop] === chart2[prop], - true, - 'Property ' + prop + ' of chart has the same behaviour after a resize as with a first render' - ); - }); - }); - - // This failed since #8160. A more robust solution would be to clip or ellipsis - // long words in the buildText function itself. - QUnit.skip('Data labels behave equally on a resize as with a first render', function (assert) { - var dataLabel1, - bounding1, - dataLabel2, - bounding2; - chart1.series[0].points.forEach(function (point, i) { - // Get datalabel from point of both charts - dataLabel1 = point.dataLabel; - dataLabel2 = chart2.series[0].points[i].dataLabel; - bounding1 = dataLabel1.element.getBoundingClientRect(); - bounding2 = dataLabel2.element.getBoundingClientRect(); - // Check if height, left, right and width is equal - // @notice left, right varied for some reason, - // and caused tests to fail in Firefox - // ['height', 'left', 'right', 'width'].forEach(function (prop) { - ['height', 'width'].forEach(function (prop) { - assert.close( - dataLabel1[prop], - dataLabel2[prop], - 0.01, - 'Property ' + prop + ' of point ' + i + ' has the same behaviour after a resize as with a first render' - ); - assert.close( - bounding1[prop], - bounding2[prop], - 0.01, - 'Property ' + prop + ' of point ' + i + ' bounding has the same behaviour after a resize as with a first render' - ); - }); - }); - }); - QUnit.test('Points behave equally on a resize as with a first render', function (assert) { - var point2; - chart1.series[0].points.forEach(function (point1, i) { - // Get datalabel from point of both charts - point2 = chart2.series[0].points[i]; - // Check if height, left, right and width is equal - ['height', 'left', 'right', 'width'].forEach(function (prop) { - assert.strictEqual( - point1[prop] === point2[prop], - true, - 'Property ' + prop + ' of point ' + i + ' has the same behaviour after a resize as with a first render' - ); - assert.strictEqual( - point1[prop] === point2[prop], - true, - 'Property ' + prop + ' of point ' + i + ' bounding has the same behaviour after a resize as with a first render' - ); - }); - }); - }); -}); diff --git a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.details b/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.details deleted file mode 100644 index 00135abb1ad..00000000000 --- a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.details +++ /dev/null @@ -1,5 +0,0 @@ ---- - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.html b/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.html deleted file mode 100644 index 6b0c2f8b77a..00000000000 --- a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
- - -
-
\ No newline at end of file diff --git a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.js b/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.js deleted file mode 100644 index 3991ae3c84a..00000000000 --- a/samples/issues/highcharts-4.2.3/5082-plot-band-export/demo.js +++ /dev/null @@ -1,75 +0,0 @@ -jQuery(function () { - - QUnit.test('Plot bands on added axis should be exported', function (assert) { - var chart = Highcharts.chart('container', { - - chart: { - height: 300 - }, - - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - - yAxis: { - title: { - text: 'Temperature' - }, - lineWidth: 2, - lineColor: '#F33', - id: 'temperature-axis' - }, - - series: [{ - name: 'Temperature', - data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], - color: '#F33' - }] - }); - - assert.strictEqual( - chart.yAxis.length, - 1, - 'Chart has one Y axis' - ); - - // Add secondary yAxis - chart.addAxis({ - id: 'rainfall-axis', - title: { - text: 'Rainfall' - }, - lineWidth: 2, - lineColor: '#08F', - opposite: true - }); - - // Add a plot band to it - chart.yAxis[1].addPlotBand({ - color: '#abcdef', - from: 12, - to: 25 - }); - - // ... and a series - chart.addSeries({ - name: 'Rainfall', - type: 'column', - color: '#08F', - yAxis: 'rainfall-axis', - data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] - }); - - // Export it - $('#exported').html(chart.getSVG()); - - - assert.strictEqual( - $('#exported path[fill="#abcdef"]').length, - 1, - 'Correctly filled path is present in the export' - ); - }); - - -}); \ No newline at end of file diff --git a/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.details b/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.details deleted file mode 100644 index 00135abb1ad..00000000000 --- a/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.details +++ /dev/null @@ -1,5 +0,0 @@ ---- - resources: - - https://code.jquery.com/qunit/qunit-2.0.1.js - - https://code.jquery.com/qunit/qunit-2.0.1.css -... \ No newline at end of file diff --git a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.details b/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.details deleted file mode 100644 index 333e8384d83..00000000000 --- a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.details +++ /dev/null @@ -1,5 +0,0 @@ ---- - resources: - - https://code.jquery.com/qunit/qunit-1.19.0.js - - https://code.jquery.com/qunit/qunit-1.19.0.css -... \ No newline at end of file diff --git a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.html b/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.html deleted file mode 100644 index ee3a2db7fc6..00000000000 --- a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.html +++ /dev/null @@ -1,9 +0,0 @@ - - -
-
- - -
-
-
diff --git a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.js b/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.js deleted file mode 100644 index 1315b4e7781..00000000000 --- a/samples/issues/highmaps-4.2.1/4964-missing-plotband-small-range/demo.js +++ /dev/null @@ -1,28 +0,0 @@ -$(function () { - QUnit.test('Missing plotband when range is small', function (assert) { - var chart = Highcharts.chart('container1', { - xAxis: { - min: 1452666442250, - max: 1453899392750, - type: 'datetime', - plotBands: [{ - color: "#BDBDBD", - from: 1453101708000, - to: 1453109508000 - }, { - color: "red", - from: 1453726531000, - to: 1453728606000 - }] - }, - series: [{ - }] - }); - - assert.strictEqual( - chart.xAxis[0].plotLinesAndBands[1].svgElem.d.split(' ')[1] !== chart.xAxis[0].plotLinesAndBands[1].svgElem.d.split(' ')[6], - true, - 'Second plotband is visible' - ); - }); -}); \ No newline at end of file diff --git a/samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.details b/samples/unit-tests/axis/label-ellipsis/demo.details similarity index 100% rename from samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.details rename to samples/unit-tests/axis/label-ellipsis/demo.details diff --git a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.html b/samples/unit-tests/axis/label-ellipsis/demo.html similarity index 65% rename from samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.html rename to samples/unit-tests/axis/label-ellipsis/demo.html index 9b44c207555..ddebe2df166 100644 --- a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.html +++ b/samples/unit-tests/axis/label-ellipsis/demo.html @@ -3,4 +3,4 @@
-
+
diff --git a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.js b/samples/unit-tests/axis/label-ellipsis/demo.js similarity index 95% rename from samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.js rename to samples/unit-tests/axis/label-ellipsis/demo.js index c488ffb57a1..81a2a742792 100644 --- a/samples/issues/highcharts-4.1.9/4678-label-ellipsis/demo.js +++ b/samples/unit-tests/axis/label-ellipsis/demo.js @@ -1,4 +1,4 @@ -QUnit.test("Ellipsis should be reset after zoom", function (assert) { +QUnit.test("Ellipsis should be reset after zoom (#4678)", function (assert) { var chart = $('#container').highcharts({ chart: { type: 'bar', @@ -33,6 +33,7 @@ QUnit.test("Ellipsis should be reset after zoom", function (assert) { }] }).highcharts(); + assert.strictEqual( typeof chart.xAxis[0].ticks[0].label.getBBox().height, 'number', @@ -67,7 +68,8 @@ QUnit.test('#5034: No ellipsis for multiline labels where there is room', functi var chart = Highcharts.chart('container', { chart: { - type: "bar" + type: "bar", + width: 500 }, xAxis: { categories: ["Cat1", "Cat2 bla bla bla bla bla bla bla bla bla bla", "Cat3 bla bla bla bla bla bla bla"] @@ -77,6 +79,7 @@ QUnit.test('#5034: No ellipsis for multiline labels where there is room', functi }] }); + assert.ok( chart.xAxis[0].ticks[1].label.getBBox().height > chart.xAxis[0].ticks[0].label.getBBox().height, 'Second label is multiple lines' diff --git a/samples/unit-tests/axis/plotlines-and-plotbands/demo.js b/samples/unit-tests/axis/plotlines-and-plotbands/demo.js index a886a12bd62..83b407f7029 100644 --- a/samples/unit-tests/axis/plotlines-and-plotbands/demo.js +++ b/samples/unit-tests/axis/plotlines-and-plotbands/demo.js @@ -1,3 +1,100 @@ +QUnit.test('Missing plotband when range is small (#4964)', function (assert) { + var chart = Highcharts.chart('container', { + xAxis: { + min: 1452666442250, + max: 1453899392750, + type: 'datetime', + plotBands: [{ + color: "#BDBDBD", + from: 1453101708000, + to: 1453109508000 + }, { + color: "red", + from: 1453726531000, + to: 1453728606000 + }] + }, + series: [{ + }] + }); + + assert.strictEqual( + chart.xAxis[0].plotLinesAndBands[1].svgElem.d.split(' ')[1] !== + chart.xAxis[0].plotLinesAndBands[1].svgElem.d.split(' ')[6], + true, + 'Second plotband is visible' + ); +}); +QUnit.test('Plot bands on added axis should be exported (#5082)', function (assert) { + var chart = Highcharts.chart('container', { + + chart: { + height: 300 + }, + + xAxis: { + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + }, + + yAxis: { + title: { + text: 'Temperature' + }, + lineWidth: 2, + lineColor: '#F33', + id: 'temperature-axis' + }, + + series: [{ + name: 'Temperature', + data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], + color: '#F33' + }] + }); + + assert.strictEqual( + chart.yAxis.length, + 1, + 'Chart has one Y axis' + ); + + // Add secondary yAxis + chart.addAxis({ + id: 'rainfall-axis', + title: { + text: 'Rainfall' + }, + lineWidth: 2, + lineColor: '#08F', + opposite: true + }); + + // Add a plot band to it + chart.yAxis[1].addPlotBand({ + color: '#abcdef', + from: 12, + to: 25 + }); + + // ... and a series + chart.addSeries({ + name: 'Rainfall', + type: 'column', + color: '#08F', + yAxis: 'rainfall-axis', + data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] + }); + + // Export it + $('#output').html(chart.getSVG()); + + assert.strictEqual( + $('#output path[fill="#abcdef"]').length, + 1, + 'Correctly filled path is present in the export' + ); +}); + QUnit.test('Defaults', assert => { const chart = Highcharts.chart('container', { diff --git a/samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.details b/samples/unit-tests/axis/reversed/demo.details similarity index 100% rename from samples/issues/highcharts-4.1.7/4359-drilldown-pie-select-color/demo.details rename to samples/unit-tests/axis/reversed/demo.details diff --git a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.html b/samples/unit-tests/axis/reversed/demo.html similarity index 63% rename from samples/issues/highcharts-4.2.1/4918-getpointspline/demo.html rename to samples/unit-tests/axis/reversed/demo.html index 182632f0de0..bbc12040203 100644 --- a/samples/issues/highcharts-4.2.1/4918-getpointspline/demo.html +++ b/samples/unit-tests/axis/reversed/demo.html @@ -1,7 +1,6 @@ + +
- - -
diff --git a/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.js b/samples/unit-tests/axis/reversed/demo.js similarity index 67% rename from samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.js rename to samples/unit-tests/axis/reversed/demo.js index 797578d6356..efc1ff5e056 100644 --- a/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.js +++ b/samples/unit-tests/axis/reversed/demo.js @@ -1,4 +1,4 @@ -QUnit.test('Reversed yAxis for bar charts cause detached columns from axis.', function (assert) { +QUnit.test('Reversed yAxis for bar charts cause detached columns from axis (#4504)', function (assert) { var options = { chart: { type: "column" @@ -18,15 +18,27 @@ QUnit.test('Reversed yAxis for bar charts cause detached columns from axis.', fu }, charts = [], point, - y, height; + y, height, container1, container2, container3, container4; - charts[0] = $("#container_1").highcharts(options).highcharts(); + container1 = document.createElement("div"); + document.body.appendChild(container1); + + container2 = document.createElement("div"); + document.body.appendChild(container2); + + container3 = document.createElement("div"); + document.body.appendChild(container3); + + container4 = document.createElement("div"); + document.body.appendChild(container4); + + charts[0] = $(container1).highcharts(options).highcharts(); options.yAxis.reversed = true; - charts[1] = $("#container_2").highcharts(options).highcharts(); + charts[1] = $(container2).highcharts(options).highcharts(); options.chart.type = "bar"; - charts[2] = $("#container_3").highcharts(options).highcharts(); + charts[2] = $(container3).highcharts(options).highcharts(); options.yAxis.reversed = false; - charts[3] = $("#container_4").highcharts(options).highcharts(); + charts[3] = $(container4).highcharts(options).highcharts(); $.each([charts[0], charts[3]], function (i, chart) { point = chart.series[0].data[1].graphic; @@ -71,4 +83,11 @@ QUnit.test('Reversed yAxis for bar charts cause detached columns from axis.', fu 'Zero point should be zero height (#4656)' ); }); + + // Clean up + charts.forEach(chart => { + const renderTo = chart.renderTo; + chart.destroy(); + renderTo.parentNode.removeChild(renderTo); + }); }); diff --git a/samples/unit-tests/data/general/demo.js b/samples/unit-tests/data/general/demo.js index b52218df7b5..3fa9a8f16b6 100644 --- a/samples/unit-tests/data/general/demo.js +++ b/samples/unit-tests/data/general/demo.js @@ -1,3 +1,66 @@ +QUnit.test("Data module with decimapPoint and negative numbers (#4749)", function (assert) { + document.body.innerHTML += ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
JaneJohn
Apples-3,4-4,24
Pears-1,2-1,5
Plums5,111,1
Bananas-1,1-1,1
Oranges-3,12-2,9
`; + var chart = $("#container").highcharts({ + data: { + table: 'datatable', + decimalPoint: ',' + }, + chart: { + type: 'column' + } + }).highcharts(); + + assert.equal( + chart.series[0].points.map(function (point) { + return point.y; + }).join(','), + '-3.4,-1.2,5.1,-1.1,-3.12', + 'Series 1 correct data' + ); + assert.equal( + chart.series[1].points.map(function (point) { + return point.y; + }).join(','), + '-4.24,-1.5,11.1,-1.1,-2.9', + 'Series 2 correct data' + ); +}); + QUnit.test('Empty data config', function (assert) { var chart = Highcharts.chart('container', { diff --git a/samples/unit-tests/dragdrop/dynamic/demo.html b/samples/unit-tests/dragdrop/dynamic/demo.html index e1f18d4581f..1c2681b49b6 100644 --- a/samples/unit-tests/dragdrop/dynamic/demo.html +++ b/samples/unit-tests/dragdrop/dynamic/demo.html @@ -6,3 +6,5 @@
+ +
diff --git a/samples/unit-tests/dragdrop/dynamic/demo.js b/samples/unit-tests/dragdrop/dynamic/demo.js index 44be702332b..60dac60b1a1 100644 --- a/samples/unit-tests/dragdrop/dynamic/demo.js +++ b/samples/unit-tests/dragdrop/dynamic/demo.js @@ -1,3 +1,113 @@ +QUnit.test('Do not change hoverChartIndex during a drag (#4906)', function (assert) { + var chart1, + chart2, + offset1, + offset2, + y, + start, + end; + + document.getElementById('container').style.maxWidth = '1210px'; + document.getElementById('container').style.width = '1210px'; + const container1 = document.createElement('div'); + document.getElementById('container').appendChild(container1); + container1.style.width = '600px'; + container1.style.cssFloat = 'left'; + const container2 = document.createElement('div'); + document.getElementById('container').appendChild(container2); + container2.style.width = '600px'; + container2.style.cssFloat = 'left'; + + + chart1 = Highcharts.chart(container1, { + chart: { + zoomType: 'x' + }, + series: [{ + data: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] + }], + title: { + text: 'Chart1' + } + }); + chart2 = Highcharts.chart(container2, { + chart: { + zoomType: 'x' + }, + series: [{ + data: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] + }], + title: { + text: 'Chart2' + } + }); + + Highcharts.each(chart1.axes, function (axis) { + if (axis.isXAxis) { + assert.strictEqual( + typeof axis.userMin, + 'undefined', + 'Chart1 has not zoomed' + ); + } + }); + Highcharts.each(chart2.axes, function (axis) { + if (axis.isXAxis) { + assert.strictEqual( + typeof axis.userMin, + 'undefined', + 'Chart2 has not zoomed' + ); + } + }); + + offset1 = Highcharts.offset(chart1.container); + offset2 = Highcharts.offset(chart2.container); + start = offset1.left + chart1.plotLeft + (chart1.plotSizeX / 2); + end = offset2.left + chart2.plotLeft + (chart2.plotSizeX / 2); + y = offset1.top + chart1.plotTop + (chart1.plotSizeY / 2); + // Do a drag and drop + chart1.pointer.onContainerMouseDown({ + type: 'mousedown', + pageX: start, + pageY: y + }); + chart1.pointer.onContainerMouseMove({ + type: 'mousemove', + pageX: end, + pageY: y + }); + chart1.pointer.onDocumentMouseUp({ + type: 'mouseup', + pageX: end, + pageY: y + }); + + // Test after interaction + Highcharts.each(chart1.axes, function (axis) { + if (axis.isXAxis) { + assert.strictEqual( + typeof axis.userMin, + 'number', + 'Chart1 has zoomed' + ); + } + }); + Highcharts.each(chart2.axes, function (axis) { + if (axis.isXAxis) { + assert.strictEqual( + typeof axis.userMin, + 'undefined', + 'Chart2 has still not zoomed' + ); + } + }); + + chart1.destroy(); + chart2.destroy(); + container1.parentNode.removeChild(container1); + container2.parentNode.removeChild(container2); +}); QUnit.test('Dragdrop enabled in dynamic chart', function (assert) { var chart = Highcharts.chart('container', { diff --git a/samples/unit-tests/drilldown/pie/demo.html b/samples/unit-tests/drilldown/pie/demo.html index 6fb5093b059..58d9d4cda87 100644 --- a/samples/unit-tests/drilldown/pie/demo.html +++ b/samples/unit-tests/drilldown/pie/demo.html @@ -1,5 +1,7 @@ + +
diff --git a/samples/unit-tests/drilldown/pie/demo.js b/samples/unit-tests/drilldown/pie/demo.js index e13426dc155..bc9e79f92c5 100644 --- a/samples/unit-tests/drilldown/pie/demo.js +++ b/samples/unit-tests/drilldown/pie/demo.js @@ -235,3 +235,81 @@ QUnit.test('Pie color and data labels', function (assert) { } }); +QUnit.test('Slice color after drilldown and select (#4359)', function (assert) { + var options = { + chart: { + type: 'pie', + options3d: { + alpha: 45, + beta: 0 + } + }, + plotOptions: { + pie: { + depth: 35, + allowPointSelect: true, + colors: ['#00e500', '#004400'] + } + + }, + series: [{ + name: "Materials", + data: [{ + y: 23.73 + }, { + y: 76.27, + drilldown: "Recycled Materials" + }] + }], + drilldown: { + series: [{ + animation: false, + id: "Recycled Materials", + data: [ + ["Tent Frames and Chairs - 6,400 lbs", 4.35], + ["Aluminum Cans - 28,950 lbs", 19.66], + ["Plastic PET Bottles - 36,420 lbs", 24.73], + ["Glass - 40,950 lbs", 27.8], + ["Cardboard - 30,000 lbs", 20.37], + ["Solo Cups - 4,556 lbs", 3.09]] + }] + } + }, + chart, chart3d, container1, container2; + + container1 = document.createElement("div"); + document.body.appendChild(container1); + container1.id = "container1"; + + container2 = document.createElement("div"); + document.body.appendChild(container2); + container2.id = "container2"; + + chart = $('#container1').highcharts(options).highcharts(); + options.chart.options3d.enabled = true; + chart3d = $('#container2').highcharts(options).highcharts(); + + chart.series[0].points[1].doDrilldown(); + chart.series[0].points[0].select(); + + chart3d.series[0].points[1].doDrilldown(); + chart3d.series[0].points[0].select(); + + assert.strictEqual( + chart.series[0].points[0].graphic.attr("fill"), + chart.series[0].options.colors[0], + 'Proper select-state color' + ); + + assert.strictEqual( + chart3d.series[0].points[0].graphic.top.attr("fill"), + chart3d.series[0].options.colors[0], + 'Proper select-state color' + ); + + chart.destroy(); + chart3d.destroy(); + + document.body.removeChild(container1); + document.body.removeChild(container2); +}); diff --git a/samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.details b/samples/unit-tests/series-map/allareas/demo.details similarity index 100% rename from samples/issues/highcharts-4.1.8/4504-bar-reversed-yaxis/demo.details rename to samples/unit-tests/series-map/allareas/demo.details diff --git a/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.html b/samples/unit-tests/series-map/allareas/demo.html similarity index 100% rename from samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.html rename to samples/unit-tests/series-map/allareas/demo.html diff --git a/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.js b/samples/unit-tests/series-map/allareas/demo.js similarity index 90% rename from samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.js rename to samples/unit-tests/series-map/allareas/demo.js index 6ebc95b3f1c..cf4622bd0c9 100644 --- a/samples/issues/highmaps-1.1.9/4784-allareas-disabled-centers-map/demo.js +++ b/samples/unit-tests/series-map/allareas/demo.js @@ -1,4 +1,4 @@ -QUnit.test('Map with allAreas disabled centers on visible areas.', assert => { +QUnit.test('Map with allAreas disabled centers on visible areas (#4784)', assert => { let chart; chart = Highcharts.mapChart('container', { diff --git a/samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.details b/samples/unit-tests/series-pie/gradient/demo.details similarity index 100% rename from samples/issues/highcharts-4.1.9/4652-label-align-in-pies/demo.details rename to samples/unit-tests/series-pie/gradient/demo.details diff --git a/samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.html b/samples/unit-tests/series-pie/gradient/demo.html similarity index 100% rename from samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.html rename to samples/unit-tests/series-pie/gradient/demo.html diff --git a/samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.js b/samples/unit-tests/series-pie/gradient/demo.js similarity index 90% rename from samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.js rename to samples/unit-tests/series-pie/gradient/demo.js index 681bd6f0339..819e920986f 100644 --- a/samples/issues/highcharts-4.1.7/3801-pie-gradient-update/demo.js +++ b/samples/unit-tests/series-pie/gradient/demo.js @@ -1,6 +1,6 @@ -QUnit.test('Pie radial gradient', function (assert) { - +QUnit.test('Pie radial gradient (#3801)', function (assert) { + const colors = Highcharts.defaultOptions.colors; // Radialize the colors Highcharts.setOptions({ colors: Highcharts.map(Highcharts.getOptions().colors, function () { @@ -68,5 +68,7 @@ QUnit.test('Pie radial gradient', function (assert) { series.center[1], 'After redraw, gradient is centered' ); - + Highcharts.setOptions({ + colors + }); }); \ No newline at end of file diff --git a/samples/unit-tests/series-spline/spline/demo.js b/samples/unit-tests/series-spline/spline/demo.js index 624d24b6c27..e9a04b59192 100644 --- a/samples/unit-tests/series-spline/spline/demo.js +++ b/samples/unit-tests/series-spline/spline/demo.js @@ -1,3 +1,38 @@ +QUnit.test('SplineSeries.getPointSpline (#4918)', function (assert) { + var getPointSpline = Highcharts.seriesTypes.spline.prototype.getPointSpline, + segment = [{ + plotX: -5, + plotY: 10 + }, { + plotX: 240, + plotY: 250 + }, { + plotX: 510, + plotY: 0 + }]; + + const mockSeries = { + chart: { + polar: false + } + }; + + function pathToString(arr) { + return arr.join(' '); + } + + assert.strictEqual( + pathToString(getPointSpline.call(mockSeries, segment, segment[1], 1)), + pathToString(['C', -5, 10, 142, 250, 240, 250]), + 'Path to point.1 is correct' + ); + assert.strictEqual( + pathToString(getPointSpline.call(mockSeries, segment, segment[2], 2)), + pathToString(['C', 348, 250, 510, 0, 510, 0]), + 'Path to point.2 is correct' + ); +}); + QUnit.test('Spline with equal X (#5016)', function (assert) { var chart = Highcharts.chart('container', { chart: { diff --git a/samples/unit-tests/series-treemap/point/demo.js b/samples/unit-tests/series-treemap/point/demo.js index 75481f9b135..686867c69eb 100644 --- a/samples/unit-tests/series-treemap/point/demo.js +++ b/samples/unit-tests/series-treemap/point/demo.js @@ -1,3 +1,133 @@ +QUnit.test('Treemap', assert => { + + const container1 = document.createElement('div'); + document.getElementById('container').appendChild(container1); + const container2 = document.createElement('div'); + document.getElementById('container').appendChild(container2); + + try { + var defaultOptions = { + chart: { + type: 'treemap', + spacing: 0 + }, + plotOptions: { + treemap: { + shadow: null, + layoutAlgorithm: 'squarified', + datalabels: { + crop: false + } + } + }, + credits: false, + series: [{ + data: [{ + id: 'A', + name: 'Ana are mere si peremgfdjgj fddifjhdfi oidgjhodgj dtjhod kngfjgiodfjhoi fofijhofo hjohjod ogfjho jgfk f hgf hfg', + value: 6, + color: 'red' + }, { + id: 'B', + name: 'Ana are mere si peremgfdjgj fddifjhdfi oidgjhodgj dtjhod kngfjgiodfjhoi fofijhofo hjohjod ogfjho jgfk f hgf hfg', + value: 6, + color: 'blue' + }, { + id: 'C', + name: 'Ana are mere si castraveti', + value: 4, + color: 'green' + }] + }], + title: { + text: null + } + }, + // Create chart1 with width calculated from the container and default height of 400px + chart1 = Highcharts.chart(container1, defaultOptions), + + // Create chart2 with width of 470px and height of 400px + chart2 = Highcharts.chart(container2, (function () { + defaultOptions.chart.width = 470; + defaultOptions.chart.height = 400; + return defaultOptions; + }())); + + // Update chart1 with the same height and width as chart2 + chart1.setSize(470, 400, false); + + // Check if height, left, right and width is equal + ['chartHeight', 'chartWidth', 'plotHeight', 'plotLeft', 'plotSizeX', 'plotSizeX', 'plotTop', 'plotWidth'].forEach(function (prop) { + assert.strictEqual( + chart1[prop] === chart2[prop], + true, + 'Property ' + prop + ' of chart has the same behaviour after a resize as with a first render' + ); + }); + + // This failed since #8160. A more robust solution would be to clip or ellipsis + // long words in the buildText function itself. + /* + var dataLabel1, + bounding1, + dataLabel2, + bounding2; + chart1.series[0].points.forEach(function (point, i) { + // Get datalabel from point of both charts + dataLabel1 = point.dataLabel; + dataLabel2 = chart2.series[0].points[i].dataLabel; + bounding1 = dataLabel1.element.getBoundingClientRect(); + bounding2 = dataLabel2.element.getBoundingClientRect(); + // Check if height, left, right and width is equal + // @notice left, right varied for some reason, + // and caused tests to fail in Firefox + // ['height', 'left', 'right', 'width'].forEach(function (prop) { + ['height', 'width'].forEach(function (prop) { + assert.close( + dataLabel1[prop], + dataLabel2[prop], + 0.01, + 'Property ' + prop + ' of point ' + i + ' has the same behaviour after a resize as with a first render' + ); + assert.close( + bounding1[prop], + bounding2[prop], + 0.01, + 'Property ' + prop + ' of point ' + i + ' bounding has the same behaviour after a resize as with a first render' + ); + }); + }); + */ + + var point2; + chart1.series[0].points.forEach(function (point1, i) { + // Get datalabel from point of both charts + point2 = chart2.series[0].points[i]; + // Check if height, left, right and width is equal + ['height', 'left', 'right', 'width'].forEach(function (prop) { + assert.strictEqual( + point1[prop] === point2[prop], + true, + 'Property ' + prop + ' of point ' + i + ' should have the same behaviour after a resize as with a first render' + ); + assert.strictEqual( + point1[prop] === point2[prop], + true, + 'Property ' + prop + ' of point ' + i + ' bounding should have the same behaviour after a resize as with a first render' + ); + }); + }); + + } finally { + + chart1.destroy(); + chart2.destroy(); + + document.getElementById('container').removeChild(container1); + document.getElementById('container').removeChild(container2); + } +}); + QUnit.test('point.isValid', function (assert) { var isValid = Highcharts.seriesTypes.treemap.prototype.pointClass.prototype.isValid, context = {}; diff --git a/samples/unit-tests/svgrenderer/label/demo.html b/samples/unit-tests/svgrenderer/label/demo.html index 182632f0de0..68a0a6e3ed4 100644 --- a/samples/unit-tests/svgrenderer/label/demo.html +++ b/samples/unit-tests/svgrenderer/label/demo.html @@ -1,4 +1,6 @@ + +
diff --git a/samples/unit-tests/svgrenderer/label/demo.js b/samples/unit-tests/svgrenderer/label/demo.js index fed8753e150..5d574e87807 100644 --- a/samples/unit-tests/svgrenderer/label/demo.js +++ b/samples/unit-tests/svgrenderer/label/demo.js @@ -456,3 +456,40 @@ QUnit.test('Labels with useHTML', assert => { 'The span width should adapt to shorter text (#10009)' ); }); + +QUnit.test("Change of label alignment after add (#4652)", function (assert) { + var ren = new Highcharts.Renderer( + document.getElementById('container'), + 500, + 300 + ); + + var lbl = ren.label('Hello World', 100, 100) + .attr({ + //align: 'right', + fill: 'silver' + }) + .add(); + + + var g = ren.box.querySelector('g'); + + + assert.close( + g.getBoundingClientRect().left, + 100 + document.getElementById('container').offsetLeft, + 1, // +/- 0.5px in Edge + "Box is left aligned" + ); + + + lbl.attr({ align: 'right' }); + + assert.close( + g.getBoundingClientRect().right, + 100 + document.getElementById('container').offsetLeft, + 1, // +/- 0.5px in Edge + "Box is right aligned" + ); + +}); diff --git a/test/karma-files.json b/test/karma-files.json index b903c3b76f8..589c73b6b6b 100644 --- a/test/karma-files.json +++ b/test/karma-files.json @@ -13,7 +13,7 @@ "code/modules/stock.src.js", "code/modules/map.src.js", "code/modules/gantt.src.js", - + "code/modules/exporting.src.js", "code/modules/export-data.src.js", "code/modules/parallel-coordinates.src.js", @@ -64,6 +64,7 @@ "code/indicators/indicators-all.src.js", "node_modules/@highcharts/map-collection/countries/gb/gb-all.js", + "node_modules/@highcharts/map-collection/custom/british-isles-all.js", "samples/data/maps/bn-all.js", "samples/data/maps/ad-all.js", "samples/data/maps/europe.js", diff --git a/ts/modules/debugger.src.ts b/ts/modules/debugger.src.ts index 531c2c9cc8d..c492be55a57 100644 --- a/ts/modules/debugger.src.ts +++ b/ts/modules/debugger.src.ts @@ -80,7 +80,7 @@ addEvent(H.Chart, 'displayError', function ( }); } - if (options && options.displayErrors) { + if (options && options.displayErrors && renderer) { chart.errorElements = []; msg = isNumber(code) ? (