Permalink
Browse files

Fixed #5220, resizing of polar charts regression.

  • Loading branch information...
oysteinmoseng committed Apr 18, 2016
1 parent 628bc13 commit c8ec101a88fd10de0711c28fc945b0f5454f79fe
@@ -2601,7 +2601,9 @@ var arrayMin = Highcharts.arrayMin,
point = points[i];
start = point.barX + startAngleRad;
point.shapeType = 'path';
point.shapeArgs = this.polarArc(point.yBottom, point.plotY, start, start + point.pointWidth);
point.shapeArgs = {
d: this.polarArc(point.yBottom, point.plotY, start, start + point.pointWidth)
};
// Provide correct plotX, plotY for tooltip
this.toXY(point);
point.tooltipPos = [point.plotX, point.plotY];
@@ -358,7 +358,9 @@
point = points[i];
start = point.barX + startAngleRad;
point.shapeType = 'path';
point.shapeArgs = this.polarArc(point.yBottom, point.plotY, start, start + point.pointWidth);
point.shapeArgs = {
d: this.polarArc(point.yBottom, point.plotY, start, start + point.pointWidth)
};
// Provide correct plotX, plotY for tooltip
this.toXY(point);
point.tooltipPos = [point.plotX, point.plotY];
@@ -0,0 +1,5 @@
---
resources:
- https://code.jquery.com/qunit/qunit-1.19.0.js
- https://code.jquery.com/qunit/qunit-1.19.0.css
...
@@ -0,0 +1,8 @@
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div id="container" style="width: 600px; margin: 0 auto"></div>
@@ -0,0 +1,89 @@
$(function () {
QUnit.test('Polar chart resize', function (assert) {
var chart;
$('#container').highcharts({
chart: {
polar: true,
width: 400,
height: 400
},
title: {
text: 'Highcharts Polar Chart'
},
pane: {
startAngle: 0,
endAngle: 360
},
xAxis: {
tickInterval: 45,
min: 0,
max: 360,
labels: {
formatter: function () {
return this.value + '°';
}
}
},
yAxis: {
min: 0
},
plotOptions: {
series: {
pointStart: 0,
pointInterval: 45
},
column: {
pointPadding: 0,
groupPadding: 0
}
},
series: [{
type: 'column',
name: 'Column',
data: [8, 7, 6, 5, 4, 3, 2, 1],
pointPlacement: 'between'
}, {
type: 'line',
name: 'Line',
data: [1, 2, 3, 4, 5, 6, 7, 8]
}, {
type: 'area',
name: 'Area',
data: [1, 8, 2, 7, 3, 6, 4, 5]
}]
});
chart = $('#container').highcharts();
assert.strictEqual(
chart.container.firstChild.clientWidth,
400,
'Chart has correct width'
);
chart.setSize(70, 70, false);
assert.strictEqual(
chart.container.firstChild.clientWidth,
70,
'Chart has correct width after setSize to smaller'
);
chart.setSize(500, 500, false);
assert.strictEqual(
chart.container.childNodes[0].clientWidth,
500,
'Chart has correct width after setSize to larger'
);
});
});

0 comments on commit c8ec101

Please sign in to comment.