1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    15
    Vote Rating
    0
    reis3k is on a distinguished road

      0  

    Default How to show Catagories in the legend instead of the name of the Store's data field

    How to show Catagories in the legend instead of the name of the Store's data field


    Hi All,
    Default behavior of the Ext JS chart is a little strange: While Bar and Column charts shows the Store's data field's name e.g. data1, the Pie chart shows the values of Store's name field e.g. Jan, Feb...

    PHP Code:
        var store1 = new Ext.data.JsonStore({
        
    fields:['name''data1'],
        
    data: [
            {
    name:'Jan'data12000},{name:'Feb'data11800},
            {
    name:'Mar'data11500},{name:'Apr'data12150},
            {
    name:'May'data12210},{name:'Jun'data12250},
            {
    name:'Jul'data12370},{name:'Aug'data12500},
            {
    name:'Sep'data13000},{name:'Oct'data12580},
            {
    name:'Nov'data12100},{name:'Dec'data12650}
        ]}); 
    Is it possible to get a behavior like in Pie chart to the Bar and Column charts? I've been searching fro this nearly full 2 days, but couldn't come across anything.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    828
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The legend isn't that configurable.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    15
    Vote Rating
    0
    reis3k is on a distinguished road

      0  

    Default


    Then I have to create my own legend. Can you post the code how to get the color of the bar/column. I tried to get it where I applied custom colors under renderer, but it returns duplicated values, not the exact amount of available data and color. I used Jquery to append the values into a div:

    PHP Code:
            series: [{
                
    type'bar',
                
    axis: ['bottom'],
                
    xField'name',
                
    yField'data1',
                
    label: {
                    
    display'insideEnd',
                    
    field'data1',
                    
    orientation'horizontal',
                    
    color'#333',
                   
    'text-anchor''middle',
                   
    contrasttrue
                
    },
                
    renderer: function(spriterecordattrindexstore) {
                    var 
    colorVal colors2[index colors2.length];
                    
    attr.fill colorVal;

                    
    //$("#legendDiv").append("Value: " +  record.get('name') + ", color: " + colorVal);
                    
    return attr;
                    
                }
            }]
        }); 
    Thanks

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi