1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default Unanswered: Problem with Chart gradient

    Unanswered: Problem with Chart gradient


    I had a chart that was working correctly with gradients in 4.0.7

    Here it is:

    Code:
    gradients: [
    	{
    		angle: 90,
    		id: 'gradient1',
    		stops: {
    			0: {
    				color: T.Config.UI.COLORS.MARASCHINO
    			},
    			100: {
    				color: T.Config.UI.COLORS.DARK_MARASCHINO
    			}
    		}
    	},
    	{
    		angle: 90,
    		id: 'gradient2',
    		stops: {
    			0: {
    				color: T.Config.UI.COLORS.LEMON
    			},
    			100: {
    				color: T.Config.UI.COLORS.DARK_LEMON
    			}
    		}
    	},
    	{
    		angle: 90,
    		id: 'gradient3',
    		stops: {
    			0: {
    				color: T.Config.UI.COLORS.SPRING
    			},
    			100: {
    				color: T.Config.UI.COLORS.DARK_SPRING
    			}
    		}
    	},
    	{
    		angle: 90,
    		id: 'gradient4',
    		stops: {
    			0: {
    				color: T.Config.UI.COLORS.LEAD
    			},
    			100: {
    				color: T.Config.UI.COLORS.IRON
    			}
    		}
    	}
    ]
    and the renderer:

    Code:
    renderer: function(sprite, record, attr, index, store) {
    	var fill;
    	switch(index) {
    		case 0:
    			fill = 'url(#gradient1)';
    			break;
    		case 1:
    			fill = 'url(#gradient2)';
    			break;
    		case 2:
    			fill = 'url(#gradient3)';
    			break;
    		default:
    			fill = 'url(#gradient4)';
    			break;
    	};
    	return Ext.apply(attr, {
    		fill: fill
    	});
    }
    All my bars show up black in color. Any ideas what needs to be done to get gradients to work with 4.1?

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default


    Any ideas on this one? Thanks!

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    7
    Answers
    2
    Vote Rating
    2
    Follon is on a distinguished road

      0  

    Default


    Nobody has an answer ?


    I am facing this problem too. I try to fill a sprite in a draw.Component, but it is shown in black instead of my gradient color.

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
    wbabich is on a distinguished road

      0  

    Default Maybe this helps

    Maybe this helps


    The definition of the gradients should be a property of the chart, but the renderer needs to be a property of the series.
    Is that how you have it?

Thread Participants: 2