Results 1 to 7 of 7

Thread: How can I add a button to charts

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Answers
    1
    Vote Rating
    1
      0  

    Default How can I add a button to charts

    Please advise

  2. #2
    Sencha User Hermes.Gonzalez's Avatar
    Join Date
    Aug 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default

    hellow thomson,
    That way help you?
    grafico.JPG
    Or would that be within the chart?
    If it is within the chart, you will have to extend the component, and rewrite some methods or add a div forced into it, but the ext will not control.

    If the example help you, this is the code:

    Code:
    Ext.define('app.ClassName', {
        extend : 'Ext.panel.Panel',    
        initComponent : function(){
            
            .
            .
            .
            
            this.dockedItems = [{
                xtype: 'toolbar',
                dock: 'top',
                items: [this.comboMeses,
                        {
                            xtype : 'button',                
                            iconCls: 'x-tool-refresh',                
                            handler : function(){                            
                                this.reload();
                            },
                            scope : this
                        }
                ]
            }];
            
            this.items = [                            
                {
                    xtype: 'chart',
                    style: 'background:#fff',
                    animate: true,
                    store: this.store,
                    shadow: true,
                    theme: 'Category1',
                    region : 'center',
                    layout : 'fit',                
                    legend: {
                        position: 'right'
                    },
                    axes: [{
                        type: 'Numeric',
                        minimum: 0,
                        position: 'left',
                        fields: ['nr_qtde'],
                        title: 'Number of Hits',
                        minorTickSteps: 1,
                        grid: {
                            odd: {
                                opacity: 1,
                                fill: '#ddd',
                                stroke: '#bbb',
                                'stroke-width': 0.5
                            }
                        }
                    }, {
                        type: 'Category',
                        position: 'bottom',
                        fields: ['nm_canal'],
                        title: 'Month of the Year'
                    }],
                    series: [{
                        type: 'line',
                        highlight: {
                            size: 7,
                            radius: 7
                        },
                        axis: 'left',
                        xField: 'nm_canal',
                        yField: 'nr_qtde',
                        markerConfig: {
                            type: 'cross',
                            size: 4,
                            radius: 4,
                            'stroke-width': 0
                        }
                    }]
                }
            ];
            
            this.callParent(arguments);
        }
    });

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Answers
    1
    Vote Rating
    1
      0  

    Default

    Thanks for your information. I think we should have a way create a button in the chart like http://highcharts.com/demo/. Do you have any advise?
    Many thanks
    Thomson

  4. #4
    Sencha User Hermes.Gonzalez's Avatar
    Join Date
    Aug 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default

    Hi thomson,
    The buttons are out of the chart, like we can see.

    grafic.jpg

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Answers
    1
    Vote Rating
    1
      0  

    Default

    yes, you are right. I just want to create print chart button in the chart. They have another js code to do that. I want to separate button code from there.

  6. #6
    Sencha User Hermes.Gonzalez's Avatar
    Join Date
    Aug 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default

    sorry, man.....I hadn't see it [ print button ].

    really, it is within the chart.
    I'll have a little more research.

    We'll be talking about.

Posting Permissions

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