Hide series when there is no legend

Hi,

i created a custom code where i hide series(by clicking on table rows).
Everything works OK if i have the Legend defined on the Chart.

But if i remove(dont define) the Legend on Chart(as is dont need it) then the error bellow is thrown:

Uncaught TypeError: Cannot read property ‘values’ of undefine

It is because of this code on the hideSeries function:

hideSeries:function(series){
	this.canvases[series].hideCanvas();
	if(this._settings.legend.values&&this._settings.legend.values[series])
		this._settings.legend.values[series].$hidden = true;
	this._drawLegend();
},

How to hide Series if i dont want the Legend shown on the Chart?

Hi,

Please add the legend with 0 width:

legend:{
   width:0
},

We will correct the issue with the legend in the next updates.

Hi,

thanks. This improves the legend a little, but the “color” squares are still there in the legend(one for each serie). Is there a way to remove them also?

Re