1. #1
    Sencha User loiane's Avatar
    Join Date
    Aug 2009
    Posts
    183
    Vote Rating
    52
    loiane is a jewel in the rough loiane is a jewel in the rough loiane is a jewel in the rough

      0  

    Default Ext 4 Chart Themes - where are they?

    Ext 4 Chart Themes - where are they?


    Hi,

    I was looking at the chart examples and I saw many of them uses the 'Category2' theme, but I could not find it.

    Code:
    Ext.create('Ext.chart.Chart', {
     *         renderTo: Ext.getBody(),
     *         width: 500,
     *         height: 300,
     *         animate: true,
     *         theme:'Category2',
     *         store: store,
     *         axes: [{
     *             type: 'Radial',
     *             position: 'radial',
     *             label: {
     *                 display: true
     *             }
     *         }],
    Does anyone know where I can find the declaration of this theme?
    Sencha/Java evangelist
    Author of ExtJS 4 First Look and Mastering Ext JS books
    English blog: http://loianegroner.com
    Portuguese blog: http://loiane.com
    Sencha Examples: https://github.com/loiane

  2. #2
    Sencha User nickbretz's Avatar
    Join Date
    Jul 2011
    Location
    Kansas City, MO
    Posts
    12
    Vote Rating
    3
    nickbretz is on a distinguished road

      0  

    Default


    You can find it in the file extjs/src/chart/theme/Base.js

    Code:
        //Create theme from color array
        for (i = 0; i < cats; i++) {
            themes['Category' + (i + 1)] = (function(category) {
                return Ext.extend(themes.Base, {
                    constructor: function(config) {
                        themes.Base.prototype.constructor.call(this, Ext.apply({
                            colors: category
                        }, config));
                    }
                });
            })(categories[i]);
        }

  3. #3
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,083
    Vote Rating
    44
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default


    Charts are based on our draw library (aka SVG) so they have their own themes.

    Category1 to Category6 and various others, plus you can create your own themes and apply them.

    there is an example here in the docs
    Teahouse Training Company
    Official Certified Sencha Trainer

    Australia / New Zealand / Singapore / Hong Kong & APAC



    SenchaWorld.com - Sencha webinars, videos, etc
    SenchaForge.org - (coming soon)
    TeahouseHQ.com - Sencha ecosystem training portal

    Code Validation : JSLint | JSONLint | JSONPLint

Thread Participants: 2

Tags for this Thread