From d84d598a082f35df5ea8739cdedcd9ca31951a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torstein=20H=C3=B8nsi?= Date: Thu, 6 Aug 2015 12:53:56 +0200 Subject: [PATCH] Fixed #3379, minPadding and maxPadding was wrong on color axis. --- js/highmaps.src.js | 4 +- js/modules/heatmap.src.js | 4 +- js/modules/map.src.js | 4 +- js/parts-map/ColorAxis.js | 4 +- .../3379-coloraxis-padding/demo.details | 5 +++ .../3379-coloraxis-padding/demo.html | 7 ++++ .../3379-coloraxis-padding/demo.js | 37 +++++++++++++++++++ 7 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.details create mode 100644 samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.html create mode 100644 samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.js diff --git a/js/highmaps.src.js b/js/highmaps.src.js index 750abd21085..a743f73a490 100644 --- a/js/highmaps.src.js +++ b/js/highmaps.src.js @@ -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, @@ -16319,7 +16321,6 @@ extend(ColorAxis.prototype, { side: horiz ? 2 : 1, reversed: !horiz }, userOptions, { - isX: horiz, opposite: !horiz, showEmpty: false, title: null, @@ -16338,7 +16339,6 @@ extend(ColorAxis.prototype, { this.initStops(userOptions); // Override original axis properties - this.isXAxis = true; this.horiz = horiz; this.zoomEnabled = false; }, diff --git a/js/modules/heatmap.src.js b/js/modules/heatmap.src.js index 5760c2ac714..3614e2ad658 100644 --- a/js/modules/heatmap.src.js +++ b/js/modules/heatmap.src.js @@ -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, @@ -71,7 +73,6 @@ extend(ColorAxis.prototype, { side: horiz ? 2 : 1, reversed: !horiz }, userOptions, { - isX: horiz, opposite: !horiz, showEmpty: false, title: null, @@ -90,7 +91,6 @@ extend(ColorAxis.prototype, { this.initStops(userOptions); // Override original axis properties - this.isXAxis = true; this.horiz = horiz; this.zoomEnabled = false; }, diff --git a/js/modules/map.src.js b/js/modules/map.src.js index d741c69077e..1ec8f425f5c 100644 --- a/js/modules/map.src.js +++ b/js/modules/map.src.js @@ -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, @@ -183,7 +185,6 @@ extend(ColorAxis.prototype, { side: horiz ? 2 : 1, reversed: !horiz }, userOptions, { - isX: horiz, opposite: !horiz, showEmpty: false, title: null, @@ -202,7 +203,6 @@ extend(ColorAxis.prototype, { this.initStops(userOptions); // Override original axis properties - this.isXAxis = true; this.horiz = horiz; this.zoomEnabled = false; }, diff --git a/js/parts-map/ColorAxis.js b/js/parts-map/ColorAxis.js index 77165b0fdd8..758001355d2 100644 --- a/js/parts-map/ColorAxis.js +++ b/js/parts-map/ColorAxis.js @@ -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, @@ -40,7 +42,6 @@ extend(ColorAxis.prototype, { side: horiz ? 2 : 1, reversed: !horiz }, userOptions, { - isX: horiz, opposite: !horiz, showEmpty: false, title: null, @@ -59,7 +60,6 @@ extend(ColorAxis.prototype, { this.initStops(userOptions); // Override original axis properties - this.isXAxis = true; this.horiz = horiz; this.zoomEnabled = false; }, diff --git a/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.details b/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.details new file mode 100644 index 00000000000..f9111b2d63b --- /dev/null +++ b/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.details @@ -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 +... \ No newline at end of file diff --git a/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.html b/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.html new file mode 100644 index 00000000000..a5fb165225e --- /dev/null +++ b/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.html @@ -0,0 +1,7 @@ + + + +
+
+ +
\ No newline at end of file diff --git a/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.js b/samples/issues/highmaps-1.1.7/3379-coloraxis-padding/demo.js new file mode 100644 index 00000000000..7114b44115a --- /dev/null +++ b/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' + ); + + + }); + + + +}); \ No newline at end of file