1. #1
    Sencha User loiane's Avatar
    Join Date
    Aug 2009
    Posts
    171
    Vote Rating
    41
    loiane has a spectacular aura about loiane has a spectacular aura about loiane has a spectacular aura about

      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
    2
    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 - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    738
    Vote Rating
    6
    dawesi will become famous soon enough

      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
    Check out SenchaWorld.com for articles, screencasts, conference videos and more.

    Sencha Technical Training : Asia Pacific Region

    Code Validation : JSLint | JSONLint | JSONPLint

Tags for this Thread