Skip to content

Commit

Permalink
Fixed issue with updating to line series when starting with a spline. C…
Browse files Browse the repository at this point in the history
…loses #2270.
  • Loading branch information
TorsteinHonsi committed Sep 20, 2013
1 parent 19ffd96 commit c5613f1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion js/highcharts.src.js
Expand Up @@ -14162,7 +14162,9 @@ Series.prototype = {
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type;
oldType = this.type,
proto = seriesTypes[oldType].prototype,
n;

// Do the merge, with some forced options
newOptions = merge(oldOptions, {
Expand All @@ -14173,6 +14175,11 @@ Series.prototype = {

// Destroy the series and reinsert methods from the type prototype
this.remove(false);
for (n in proto) { // Overwrite series-type specific methods (#2270)
if (proto.hasOwnProperty(n)) {
this[n] = UNDEFINED;
}
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);


Expand Down
9 changes: 8 additions & 1 deletion js/highstock.src.js
Expand Up @@ -14162,7 +14162,9 @@ Series.prototype = {
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type;
oldType = this.type,
proto = seriesTypes[oldType].prototype,
n;

// Do the merge, with some forced options
newOptions = merge(oldOptions, {
Expand All @@ -14173,6 +14175,11 @@ Series.prototype = {

// Destroy the series and reinsert methods from the type prototype
this.remove(false);
for (n in proto) { // Overwrite series-type specific methods (#2270)
if (proto.hasOwnProperty(n)) {
this[n] = UNDEFINED;
}
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);


Expand Down
9 changes: 8 additions & 1 deletion js/parts/Series.js
Expand Up @@ -2049,7 +2049,9 @@ Series.prototype = {
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type;
oldType = this.type,
proto = seriesTypes[oldType].prototype,
n;

// Do the merge, with some forced options
newOptions = merge(oldOptions, {
Expand All @@ -2060,6 +2062,11 @@ Series.prototype = {

// Destroy the series and reinsert methods from the type prototype
this.remove(false);
for (n in proto) { // Overwrite series-type specific methods (#2270)
if (proto.hasOwnProperty(n)) {
this[n] = UNDEFINED;
}
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);


Expand Down

0 comments on commit c5613f1

Please sign in to comment.