Skip to content

Instantly share code, notes, and snippets.

@tripp
Created June 26, 2013 21:05
Show Gist options
  • Save tripp/5871675 to your computer and use it in GitHub Desktop.
Save tripp/5871675 to your computer and use it in GitHub Desktop.
Temporary hack addressing issue in which a legend tries to redraw without available data.
Y.CartesianChart.prototype._dataProviderChangeHandler = function(e) {
var dataProvider = e.newVal,
axes,
i,
axis;
this._seriesIndex = -1;
this._itemIndex = -1;
this._drawing = true;
if(this instanceof Y.CartesianChart)
{
this.set("axes", this.get("axes"));
this.set("seriesCollection", this.get("seriesCollection"));
}
axes = this.get("axes");
this._drawing = false;
this._callLater = false;
if(axes)
{
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
axis = axes[i];
if(axis instanceof Y.Axis)
{
if(axis.get("position") !== "none")
{
this._addToAxesRenderQueue(axis);
}
axis.set("dataProvider", dataProvider);
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment