1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
    sandeepmnit35 is on a distinguished road

      0  

    Default Chart is not rendering

    Chart is not rendering


    I want to add the series on the basis of one parameter and number of series will depend on the parameter so I will be making the array of series like below :
    HTML Code:
      for(i=0; i<4;i++)
                                    {
                                        ReplayAnalytics.app.serieschart[i] = {
                                            type: 'line',
                                        axis: 'left',
                                        //gutter: 80,
                                        highlight: true,
                                        xField: ReplayAnalytics.app.xs[ReplayAnalytics.app.currentActivePanelIndex],
                                        yField: ReplayAnalytics.app.groupByValueBar[i],
                                        title:  ReplayAnalytics.app.groupByBarLabels[i]
                                    };
                                        }
    I want to add this series array to my chart . I am using below code but it is not rendering the graph. It is showing the legend labels only.

    HTML Code:
    createLineChartGroupBy: function(store,chartIndex) {
            
            RA.app.newChart[RA.app.currentActivePanelIndex] = new Ext.chart.Chart({
                id: 'chart'+RA.app.currentActivePanelIndex,
                store: store,
                renderTo: Ext.getBody(),
                flex: 1,
                shadow: true,
                autoShow: true,
                animate: { duration: RA.app.animateSpeed, delay: 0, easing: 'ease' },
                maxGutter: [10, 10],
                legend: {
                    position: 'right',
                },
                axes: [
                    {
                        type: 'Numeric',
                        position: 'left',
                        fields:[RA.app.groupByValueBar[0],RA.app.groupByValueBar[1],RA.app.groupByValueBar[2],RA.app.groupByValueBar[3],"others"],
                        label: {
                            renderer: Ext.util.Format.numberRenderer('0,0'),
                        },
                        title: RA.app.ys[RA.app.currentActivePanelIndex],
                        minimum: 0,
                        maximum: RA.app.Ymax[RA.app.currentActivePanelIndex]
                    },
                    {
                        type: 'Category',
                        position: 'bottom',
                        fields: RA.app.xs[RA.app.currentActivePanelIndex],
                        title: RA.app.xs[RA.app.currentActivePanelIndex]
                    }
                ],
                
                //series: [RA.app.serieschart],
            }); 
                 //var oldSeries = RA.app.newChart[RA.app.currentActivePanelIndex].series.pop();
                   RA.app.newChart[RA.app.currentActivePanelIndex].setSeries(RA.app.serieschart);
                   RA.app.newChart[RA.app.currentActivePanelIndex].setStore(store);
                   RA.app.newChart[RA.app.currentActivePanelIndex].getStore().sync();
        },
    
    Any one know what mistake I am doing here.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,107
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    The series needs to be defined at instantiation not at runtime.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread