Results 1 to 6 of 6

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

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    Bratislava
    Posts
    12

    Default sencha-charts - Ext.ComponentQuery.query('chart[name=myChart]') returns empty array

    Hi guys,

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

    In ExtJS 4.2.1 I used
    Code:
    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
    Code:
    chartParentCmp.down('chart[name=myChart]')
    , but in the end it is the same code internally, I suppose.

    [Browser]
    Firefox and Chrome

    [OS]
    Ubuntu 14.04 LTS

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    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.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    Ext.chart.Chart will also be removed in the next release.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Location
    Bratislava
    Posts
    12

    Default

    In http://dev.sencha.com/ext/5.0.0/exam...e#basic-column deprecated xtypes cartesian and polar are used.

    Docu says we should use Ext.chart.Chart directly:
    http://docs.sencha.com/extjs/5.0.0/a...art.PolarChart

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

    In upgrade guide: http://docs.sencha.com/extjs/5.0.0/w...ade_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 class once it is removed?

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    Ext.chart.CartesianChart and Ext.chart.PolarChart should be used, they are not deprecated. Ext.chart.Chart was removed just a couple days ago.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Location
    Phoenix AZ
    Posts
    118

    Default

    For anyone else that stumbles on this.

    The problem still exists in ExtJS 7.0.0 It is related to items in the chart (sprites I think) that do not have an isXType function.

    So you have to remove the xtype from the ComponentQuery. (up and down both use ComponentQuery.js)


    chartParentCmp.down('chart[name=myChart]'); add a reference for something that will make it unique and search by that property.

    ie
    chartParentCmp.down('[name=myChart]') will not throw an error....

    -Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •