View Full Version : sencha-charts - Ext.ComponentQuery.query('chart[name=myChart]') returns empty array

26 May 2014, 8:35 AM
Hi guys,

After upgrading from extjs charts to sencha charts, the component query for
xtype: 'chart' does not work.

In ExtJS 4.2.1 I used
Ext.ComponentQuery.query('chart[name=myChart]') and the chart component was returned as array element.

After upgrading to 5.0.0, the same code returns empty array.

I first noticed this problem while using method
chartParentCmp.down('chart[name=myChart]'), but in the end it is the same code internally, I suppose.

Firefox and Chrome

Ubuntu 14.04 LTS

27 May 2014, 5:49 AM
Ext.chart.Chart is only for API compatibility of Ext JS and Touch in the new package. Internally, Ext.chart.Chart creates Ext.chart.CartesianChart or Ext.chart.PolarChart based on the chartType config or the first series type. So when you create an Ext.chart.Chart instance, you likely are not actually seeing an Ext.chart.Chart instance but Cartesian or Polar.

28 May 2014, 10:24 AM
Ext.chart.Chart will also be removed in the next release.

30 May 2014, 12:54 AM
In http://dev.sencha.com/ext/5.0.0/examples/kitchensink/?charts=true#basic-column deprecated xtypes cartesian and polar are used.

Docu says we should use Ext.chart.Chart (http://docs.sencha.com/extjs/5.0.0/apidocs/#%21/api/Ext.chart.Chart) directly:

But as you suggested, this class will be removed in the next release.

In upgrade guide: http://docs.sencha.com/extjs/5.0.0/whats_new/5.0/charts_upgrade_guide.html
there is no note about the base class and how it will be treated in future.

Even though the migration from extjs-charts to sencha-charts worked for me, I am not sure if this will be so with the GA release.

Could you please explain what will be the replacement for Ext.chart.Chart (http://docs.sencha.com/extjs/5.0.0/apidocs/#%21/api/Ext.chart.Chart) class once it is removed?

30 May 2014, 3:07 AM
Ext.chart.CartesianChart and Ext.chart.PolarChart should be used, they are not deprecated. Ext.chart.Chart was removed just a couple days ago.