Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    1
    Vote Rating
    0
    barlos is on a distinguished road

      0  

    Default Unanswered: Build a pie chart from an array in a store

    Unanswered: Build a pie chart from an array in a store


    Hi all,

    I would like to display a pie chart, the xField and labelField values are in an array in my store, how can my Serie access this values? I need this store because it contains a value used as title of the view.

    Here is the model of the store :
    Code:
    Ext.define('mBankingApp.model.AssetView', {
      extend: 'Ext.data.Model',
      config: {
        idProperty: 'subscriptionId',
    
    
        fields : [
          {name: 'subscriptionId',    type: Ext.data.Types.INTEGER},
          {name: 'portfolioId',       type: Ext.data.Types.STRING},
          {name: 'totalAssetValue',   type: Ext.data.Types.STRING},
          {name: 'assetList'          }  // Array of Assets
        ]
      }
    });
    Here is the model of the array in the store :
    Code:
    Ext.define('mBankingApp.model.Asset', {
      extend: 'Ext.data.Model',
      config: {
        idProperty: 'assetId',
    
    
        fields : [
          {name: 'assetId',    type: Ext.data.Types.INTEGER},
          {name: 'assetCategoryCode', type: Ext.data.Types.STRING},
          {name: 'assetCategoryLabel',type: Ext.data.Types.STRING},
          {name: 'assetValue',        type: Ext.data.Types.FLOAT}
        ]
      }
    });
    And here is my chart view :
    Code:
    Ext.define("mBankingApp.view.AssetViewChart", {
      extend: 'Ext.Panel',
      requires: ['Ext.chart.PolarChart', 'Ext.chart.series.Pie', 'Ext.chart.interactions.Rotate'],
      xtype: 'assetViewChart',
      config: {
        layout: 'fit',
        title: Ext.getStore('assetViewStore').getData().items[0].data.totalAssetValue,
        
        items: [
        {
          layout: 'fit',
          xtype: 'polar',
          store: 'assetViewStore',
          animate: true,
          colors: ["#115fa6", "#94ae0a", "#a61120", "#ff8809", "#ffd13e"],
          interactions: ['rotate', 'itemhighlight'],
          legend: {
            docked: 'right',
            verticalwidth: 100
          },
          innerPadding: 45,
          series: [
            {
            type: 'pie',
            xField: 'assetList.assetValue',
            labelField: 'assetList.assetCategoryCode',
            highlightCfg: {
              margin: 20
            },
          }]
        }]
      },
    });
    Thanks,
    Barry

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    HI!

    check this link, it will be helpful to you!
    http://www.sencha.com/forum/showthre...-Chart2.0-Beta
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Tags for this Thread