Skip to content

Commit

Permalink
Fixed problems with bar charts in VML in most recent code, related to…
Browse files Browse the repository at this point in the history
… reorganizing the code for clipping trackers. Closes #794.
  • Loading branch information
highslide-software committed Feb 29, 2012
1 parent c82e024 commit 24c1183
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
24 changes: 17 additions & 7 deletions js/highcharts.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -4180,7 +4180,7 @@ var VMLElementExtension = {
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.htmlUpdateTransform();
wrapper.updateTransform();
}

// fire an event for internal hooks
Expand Down Expand Up @@ -4209,6 +4209,11 @@ var VMLElementExtension = {
}
},

/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,

/**
* Get or set attributes
*/
Expand Down Expand Up @@ -4398,7 +4403,7 @@ var VMLElementExtension = {
// translation for animation
} else if (key === 'translateX' || key === 'translateY' || key === 'rotation') {
wrapper[key] = value;
wrapper.htmlUpdateTransform();
wrapper.updateTransform();

skipAttr = true;

Expand Down Expand Up @@ -11825,9 +11830,6 @@ Series.prototype = {
if (!series.group) {
group = series.group = renderer.g('series');

if (doClip) {
group.clip(clipRect);
}
group.attr({
visibility: series.visible ? VISIBLE : HIDDEN,
zIndex: options.zIndex
Expand Down Expand Up @@ -11863,6 +11865,15 @@ Series.prototype = {
if (chart.inverted) {
series.invertGroups();
}

// Do the initial clipping. This must be done after inverting for VML.
if (doClip && !series.hasRendered) {
group.clip(clipRect);
if (series.trackerGroup) {
series.trackerGroup.clip(chart.clipRect);
}
}


// run the animation
if (doAnimation) {
Expand All @@ -11883,7 +11894,7 @@ Series.prototype = {

series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see

series.hasRendered = true;
},

/**
Expand Down Expand Up @@ -12072,7 +12083,6 @@ Series.prototype = {
.attr({
zIndex: this.options.zIndex || 1
})
.clip(chart.clipRect)
.add(chart.trackerGroup);

}
Expand Down
24 changes: 17 additions & 7 deletions js/highstock.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -4180,7 +4180,7 @@ var VMLElementExtension = {
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.htmlUpdateTransform();
wrapper.updateTransform();
}

// fire an event for internal hooks
Expand Down Expand Up @@ -4209,6 +4209,11 @@ var VMLElementExtension = {
}
},

/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,

/**
* Get or set attributes
*/
Expand Down Expand Up @@ -4398,7 +4403,7 @@ var VMLElementExtension = {
// translation for animation
} else if (key === 'translateX' || key === 'translateY' || key === 'rotation') {
wrapper[key] = value;
wrapper.htmlUpdateTransform();
wrapper.updateTransform();

skipAttr = true;

Expand Down Expand Up @@ -11825,9 +11830,6 @@ Series.prototype = {
if (!series.group) {
group = series.group = renderer.g('series');

if (doClip) {
group.clip(clipRect);
}
group.attr({
visibility: series.visible ? VISIBLE : HIDDEN,
zIndex: options.zIndex
Expand Down Expand Up @@ -11863,6 +11865,15 @@ Series.prototype = {
if (chart.inverted) {
series.invertGroups();
}

// Do the initial clipping. This must be done after inverting for VML.
if (doClip && !series.hasRendered) {
group.clip(clipRect);
if (series.trackerGroup) {
series.trackerGroup.clip(chart.clipRect);
}
}


// run the animation
if (doAnimation) {
Expand All @@ -11883,7 +11894,7 @@ Series.prototype = {

series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see

series.hasRendered = true;
},

/**
Expand Down Expand Up @@ -12072,7 +12083,6 @@ Series.prototype = {
.attr({
zIndex: this.options.zIndex || 1
})
.clip(chart.clipRect)
.add(chart.trackerGroup);

}
Expand Down
15 changes: 10 additions & 5 deletions js/parts/Series.js
Original file line number Diff line number Diff line change
Expand Up @@ -1994,9 +1994,6 @@ Series.prototype = {
if (!series.group) {
group = series.group = renderer.g('series');

if (doClip) {
group.clip(clipRect);
}
group.attr({
visibility: series.visible ? VISIBLE : HIDDEN,
zIndex: options.zIndex
Expand Down Expand Up @@ -2032,6 +2029,15 @@ Series.prototype = {
if (chart.inverted) {
series.invertGroups();
}

// Do the initial clipping. This must be done after inverting for VML.
if (doClip && !series.hasRendered) {
group.clip(clipRect);
if (series.trackerGroup) {
series.trackerGroup.clip(chart.clipRect);
}
}


// run the animation
if (doAnimation) {
Expand All @@ -2052,7 +2058,7 @@ Series.prototype = {

series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see

series.hasRendered = true;
},

/**
Expand Down Expand Up @@ -2241,7 +2247,6 @@ Series.prototype = {
.attr({
zIndex: this.options.zIndex || 1
})
.clip(chart.clipRect)
.add(chart.trackerGroup);

}
Expand Down
9 changes: 7 additions & 2 deletions js/parts/VmlRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var VMLElementExtension = {
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.htmlUpdateTransform();
wrapper.updateTransform();
}

// fire an event for internal hooks
Expand Down Expand Up @@ -115,6 +115,11 @@ var VMLElementExtension = {
}
},

/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,

/**
* Get or set attributes
*/
Expand Down Expand Up @@ -304,7 +309,7 @@ var VMLElementExtension = {
// translation for animation
} else if (key === 'translateX' || key === 'translateY' || key === 'rotation') {
wrapper[key] = value;
wrapper.htmlUpdateTransform();
wrapper.updateTransform();

skipAttr = true;

Expand Down

0 comments on commit 24c1183

Please sign in to comment.