Results 1 to 5 of 5

Thread: Requires for Ext.chart.*

    Success! Looks like we've fixed this one. According to our records the fix was applied for IDEAPLUGIN-165 in 0.3.
  1. #1
    Sencha Premium User AussieFlem's Avatar
    Join Date
    Jan 2012
    Location
    Melbourne, Australia
    Posts
    35

    Default Answered: Requires for Ext.chart.*

    When opening an existing project with Ext.chart objects, the require management is removing any chart related classes, and does not auto-add them when you add charts, axes, series etc.

    I presume that charts are not supported (yet) - or is there a config option somewhere?

  2. Thanks AussieFlem! I have opened a bug in our bug tracker. Also I just fixed it in development so it should be in the 0.3 release which will most likely be out next week.

  3. #2
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114

    Default

    There must be a bug in the way the plugin detects references to chart classes. Can you include a code snippet that illustrates the problem? I might be able to get it fixed for 0.2.

  4. #3
    Sencha Premium User AussieFlem's Avatar
    Join Date
    Jan 2012
    Location
    Melbourne, Australia
    Posts
    35

    Default

    Code:
    /**
     * This class is the main view for the application. It is specified in app.js as the
     * "autoCreateViewport" property. That setting automatically applies the "viewport"
     * plugin to promote that instance of this class to the body element.
     *
     * TODO - Replace this content of this view to suite the needs of your application.
     */
    Ext.define('SenchaBugs.view.main.Main', {
        extend: 'Ext.container.Container',
        requires: [
            'SenchaBugs.view.main.MainController',
            'SenchaBugs.view.main.MainModel',
            'Ext.chart.CartesianChart',
            'Ext.chart.interactions.PanZoom',
            'Ext.chart.axis.Numeric',
            'Ext.chart.axis.Category',
            'Ext.chart.series.Area'
        ],
    
    
        xtype: 'app-main',
    
    
        controller: 'main',
        viewModel: {
            type: 'main'
        },
    
    
        layout: {
            type: 'border'
        },
    
    
        items: [
            {
                region: 'center',
                xtype: 'tabpanel',
                items: [
                    {
                        xtype: 'chart',
                        title: 'Chart 1',
                        store: {
                            fields: ['name', 'g1', 'g2'],
                            data: [
                                {"name": "Item-0", "g1": 18.34, "g2": 0.04},
                                {"name": "Item-1", "g1": 2.67, "g2": 14.87},
                                {"name": "Item-2", "g1": 1.90, "g2": 5.72},
                                {"name": "Item-3", "g1": 21.37, "g2": 2.13},
                                {"name": "Item-4", "g1": 2.67, "g2": 8.53},
                                {"name": "Item-5", "g1": 18.22, "g2": 4.62},
                                {"name": "Item-6", "g1": 28.51, "g2": 12.43},
                                {"name": "Item-7", "g1": 34.43, "g2": 4.40},
                                {"name": "Item-8", "g1": 21.65, "g2": 13.87},
                                {"name": "Item-9", "g1": 12.98, "g2": 35.44},
                                {"name": "Item-10", "g1": 22.96, "g2": 38.70},
                                {"name": "Item-11", "g1": 0.49, "g2": 51.90},
                                {"name": "Item-12", "g1": 20.87, "g2": 62.07},
                                {"name": "Item-13", "g1": 25.10, "g2": 78.46},
                                {"name": "Item-14", "g1": 16.87, "g2": 56.80}
                            ]
                        },
    
    
                        interactions: {
                            type: 'panzoom'
                        },
    
    
                        legend: {
                            docked: 'right'
                        },
    
    
                        axes: [
                            {
                                type: 'numeric',
                                position: 'left',
                                grid: true
                            },
                            {
                                type: 'category',
                                position: 'bottom',
                                visibleRange: [0, 0.4]
                            }
                        ],
    
    
                        series: [
                            {
                                type: 'area',
                                xField: 'name',
                                yField: ['g1', 'g2'],
                                title: ['G1', 'G2'],
                                style: {
                                    stroke: '#666666',
                                    fillOpacity: 0.8
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    });
    This works - generated app with the chart example from the Guides (and minor cleanup of redundant stuff for the sake of the example).

    Turn on the plugin management of requires and requires: changes to:


    Code:
    requires: [
            'SenchaBugs.view.main.MainController',
            'SenchaBugs.view.main.MainModel',
            'Ext.layout.container.Border',
            'Ext.tab.Panel',
            'Ext.chart.series.Cartesian'
        ],
    Interestingly it does keep the cartesian series, but doesn't see the rest of the chart elements as required.

    And I do have:
    Code:
    "requires": [
            "sencha-charts"
        ],
    set in app.json...

  5. #4
    Sencha Premium User AussieFlem's Avatar
    Join Date
    Jan 2012
    Location
    Melbourne, Australia
    Posts
    35

    Cool

    Hi Mark - just checking you saw that I'd posted the requested code example.

    Cheers

  6. #5
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114

    Default

    Thanks AussieFlem! I have opened a bug in our bug tracker. Also I just fixed it in development so it should be in the 0.3 release which will most likely be out next week.

Similar Threads

  1. Replies: 2
    Last Post: 12 Apr 2015, 10:48 PM
  2. [CLOSED] Chart requires width and height, layout 'fit' doesn't work
    By Ronaldo in forum Ext 5: Bugs
    Replies: 1
    Last Post: 14 Aug 2014, 4:46 AM
  3. Replies: 2
    Last Post: 13 Apr 2012, 7:34 AM
  4. [FIXED] [4.1.0 RC2] Missing requires in Ext.chart.axis.Numeric
    By Zadneram in forum Ext:Bugs
    Replies: 1
    Last Post: 4 Apr 2012, 3:08 AM
  5. I don't know what's 'requires' do?
    By jsveron23 in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 30 Jan 2012, 8:11 AM

Tags for this Thread

Posting Permissions

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