Skip to content

Commit

Permalink
Fixed #3379, minPadding and maxPadding was wrong on color axis.
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Aug 6, 2015
1 parent 2f01128 commit d84d598
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/highmaps.src.js
Expand Up @@ -16291,6 +16291,8 @@ extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
Expand Down Expand Up @@ -16319,7 +16321,6 @@ extend(ColorAxis.prototype, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
isX: horiz,
opposite: !horiz,
showEmpty: false,
title: null,
Expand All @@ -16338,7 +16339,6 @@ extend(ColorAxis.prototype, {
this.initStops(userOptions);

// Override original axis properties
this.isXAxis = true;
this.horiz = horiz;
this.zoomEnabled = false;
},
Expand Down
4 changes: 2 additions & 2 deletions js/modules/heatmap.src.js
Expand Up @@ -43,6 +43,8 @@ extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
Expand Down Expand Up @@ -71,7 +73,6 @@ extend(ColorAxis.prototype, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
isX: horiz,
opposite: !horiz,
showEmpty: false,
title: null,
Expand All @@ -90,7 +91,6 @@ extend(ColorAxis.prototype, {
this.initStops(userOptions);

// Override original axis properties
this.isXAxis = true;
this.horiz = horiz;
this.zoomEnabled = false;
},
Expand Down
4 changes: 2 additions & 2 deletions js/modules/map.src.js
Expand Up @@ -155,6 +155,8 @@ extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
Expand Down Expand Up @@ -183,7 +185,6 @@ extend(ColorAxis.prototype, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
isX: horiz,
opposite: !horiz,
showEmpty: false,
title: null,
Expand All @@ -202,7 +203,6 @@ extend(ColorAxis.prototype, {
this.initStops(userOptions);

// Override original axis properties
this.isXAxis = true;
this.horiz = horiz;
this.zoomEnabled = false;
},
Expand Down
4 changes: 2 additions & 2 deletions js/parts-map/ColorAxis.js
Expand Up @@ -12,6 +12,8 @@ extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
Expand Down Expand Up @@ -40,7 +42,6 @@ extend(ColorAxis.prototype, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
isX: horiz,
opposite: !horiz,
showEmpty: false,
title: null,
Expand All @@ -59,7 +60,6 @@ extend(ColorAxis.prototype, {
this.initStops(userOptions);

// Override original axis properties
this.isXAxis = true;
this.horiz = horiz;
this.zoomEnabled = false;
},
Expand Down
@@ -0,0 +1,5 @@
---
resources:
- http://code.jquery.com/qunit/qunit-1.15.0.js
- http://code.jquery.com/qunit/qunit-1.15.0.css
...
@@ -0,0 +1,7 @@
<script src="http://code.highcharts.com/highmaps.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div id="qunit"></div>
<div id="qunit-fixture"></div>

<div id="container" style="width: 400px; height: 300px"></div>
37 changes: 37 additions & 0 deletions samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.js
@@ -0,0 +1,37 @@
$(function () {

QUnit.test('Color axis padding', function (assert) {

var chart;

$('#container').highcharts({

chart: {
type: 'heatmap'
},
colorAxis: {
min: -1,
max: 1
},


series: [{
data: [[0, 0, -1], [0, 1, 1]]
}]

});

chart = $('#container').highcharts();

assert.strictEqual(
chart.colorAxis[0].toPixels(-1),
0,
'No left padding'
);


});



});

0 comments on commit d84d598

Please sign in to comment.