Results 1 to 2 of 2

Thread: Adding Series to line chart Dynamically

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    56
    Vote Rating
    0
      0  

    Question Adding Series to line chart Dynamically

    Hi,

    I am trying to add series to chart dynamically based on data obtained from the server. but i am getting the following error "Uncaught TypeError: Object [object Object],[object Object] has no method 'each'"
    In success method of my request call, the following code is written

    Code:
    var chart = Ext.getCmp('my_ChartPanel');
    var chart_series = [];
     chart_series[0] = {
         type: 'line',
        xField: 'myType',
        yField: 'value1',
    }
     chart_series[1] = {
    	 type: 'line',
            xField: 'myType',
           yField: 'value2',
     }
     chart.series = chart_series;
    chart.store.loadData(jsonData.myArray);
    I need to add the fields for the store also dynamically..I tried the following which dint work. In 'axes' also i need to pass the fields dynamically. Is it possible to do so?

    Code:
    chart.store.fields = ['myType', {type:'int',name:'value1'}, {type:'int',name:'value'}];
    Can any one help me in resolving this issue of adding series and fields dynamically?

    Thanks,
    dev_java

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Have you tried passing in actual series instances instead of config objects?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

Posting Permissions

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