Results 1 to 2 of 2

Thread: Axis label color

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Italy
    Posts
    44

    Default Axis label color

    Hi,
    I'm trying to put a color on my axis labels using label color property but has no effect.
    Is it possible?

    Code:
        axes: [
            {
                type: 'Numeric',
                position: 'left',
                fields: ['data1'],
                label: {
                    renderer: Ext4.util.Format.numberRenderer('0,0')
                },
                title: 'Sample Values',
                grid: true,
                maximum:0
            },
            {
                type: 'Category',
                position: 'bottom',
                fields: ['name'],
                title: 'Sample Metrics',
                label:{
                    rotate:{
                        degrees:270
                    }
                    ,color:'#FF0000'//<--no effect
                }                
            }
        ],
    Another question,can I put in a axis label a text like this:
    Text1
    Text2
    My text is very long and I would to separate in two lines
    Thanks

  2. #2
    Sencha User
    Join Date
    Nov 2009
    Posts
    26

    Default

    I see this is an old thread, but I had the same issue today.
    After digging in the source it seems the labels are created in Ext.chart.axis.Axis - getOrCreateLabel()
    There it seems labels are added as Ext.draw.Sprite objects, and it doesn't have the `color` attribute, but it have `fill`. It really works with `fill`:

    http://jsfiddle.net/N6s5F/ at line 57

Posting Permissions

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