Skip to content

Instantly share code, notes, and snippets.

@TorsteinHonsi
Created December 12, 2016 12:18
Show Gist options
  • Save TorsteinHonsi/4d598d0ecab9aec836c890c4862eee77 to your computer and use it in GitHub Desktop.
Save TorsteinHonsi/4d598d0ecab9aec836c890c4862eee77 to your computer and use it in GitHub Desktop.
diff --git a/js/parts-more/Pane.js b/js/parts-more/Pane.js
index 76638b1..44e155d 100644
--- a/js/parts-more/Pane.js
+++ b/js/parts-more/Pane.js
@@ -22,6 +22,8 @@ function Pane(options, chart, firstAxis) {
// Extend the Pane prototype
extend(Pane.prototype, {
+ coll: 'pane', // Member of chart.pane
+
/**
* Initiate the Pane object
*/
@@ -93,6 +95,17 @@ extend(Pane.prototype, {
innerRadius: 0,
to: Number.MAX_VALUE, // corrected to axis max
outerRadius: '105%'
+ },
+
+ update: function (options) {
+ this.chart.options.pane = merge(this.chart.options.pane, options);
+ H.erase(this.chart.pane, this);
+ each(this.chart.axes, function (axis) {
+ if (axis.pane === this) {
+ axis.pane = null;
+ axis.update({});
+ }
+ }, this);
}
});
diff --git a/js/parts-more/RadialAxis.js b/js/parts-more/RadialAxis.js
index e6554d5..cf64471 100644
--- a/js/parts-more/RadialAxis.js
+++ b/js/parts-more/RadialAxis.js
@@ -459,10 +459,10 @@ wrap(axisProto, 'init', function (proceed, chart, userOptions) {
options = this.options;
// Create the pane and set the pane options.
- if (!chart.panes) {
- chart.panes = [];
+ if (!chart.pane) {
+ chart.pane = [];
}
- this.pane = pane = chart.panes[paneIndex] = chart.panes[paneIndex] || new Pane(
+ this.pane = pane = chart.pane[paneIndex] = chart.pane[paneIndex] || new Pane(
splat(chartOptions.pane)[paneIndex],
chart,
axis
diff --git a/js/parts/Dynamics.js b/js/parts/Dynamics.js
index dbfe74f..d08029a 100644
--- a/js/parts/Dynamics.js
+++ b/js/parts/Dynamics.js
@@ -283,7 +283,7 @@ extend(Chart.prototype, /** @lends Highcharts.Chart.prototype */ {
// an id will update the first and the second respectively (#6019)
// // docs: New behaviour for unidentified items, add it to docs for
// chart.update and responsive.
- each(['xAxis', 'yAxis', 'series'], function (coll) {
+ each(['xAxis', 'yAxis', 'series', 'pane'], function (coll) {
if (options[coll]) {
each(splat(options[coll]), function (newOptions, i) {
var item = (
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment