1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    4
    Vote Rating
    0
    combobox-fan is on a distinguished road

      0  

    Default Unanswered: [Chart] Series renderer problem.

    Unanswered: [Chart] Series renderer problem.


    Hi, All!

    I need to paint particular markers of some series into other color then defined in markerConfig option during series creation. So, according to help, I can use my own series renderer:

    renderer : Function
    A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, record, attributes, index, store) to the function.
    Series configuration:
    Code:
    {
                     title: displayName,
                     type: 'line',
                     axis: 'left',
                     xField: 'name',
                     yField: yField,
                     highlight: false,
                     showMarkers: true,
                     selectionTolerance: 3,
                     renderer: this.seriesRenderer
    }
    Series renderer:
    Code:
        seriesRenderer: function(sprite, record, attributes, index, store){
            Ext.apply(attributes, {fill: "FF0000", stroke: "FF0000"});
            return attributes;
        }
    Looks like attributes returned from my renderer does not work. I've tried to change style of sprite(marker) within renderer function, but this didn't help too:
    Code:
    seriesRenderer: function(sprite, record, attributes, index, store){
        sprite.setAttributes({fill: "FF0000", stroke: "FF0000"}, true);      
        return attributes;
    }
    Does anybody know what is wrong?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Answers
    3452
    Vote Rating
    817
    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


    What Ext JS 4 version are you using?
    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
    Aug 2010
    Posts
    4
    Vote Rating
    0
    combobox-fan is on a distinguished road

      0  

    Default


    I've tried this on 4.1 beta 1 and 2

Thread Participants: 1

Tags for this Thread