Jump to content

Recommended Posts

Posted

Hi,

 

Can you try this approach for now?!:

 

1. UnimChart -> ClientEvents -> UniEvents -> Ext.chart.CartesianChart[chart] -> function chart.beforeInit:

function chart.beforeInit(sender, config)
{
    // gradients config
    config.gradients = [{
        id: 'gradientId1',
        type: 'linear',
        angle: 45,
        stops: [{
            offset: 0,
            color: 'red'
        }, {
            offset: 1,
            color: 'yellow'
        }]
    }, {
        id: 'gradientId2',
        type: 'radial',
        stops: [{
            offset: 0,
            color: '#555',
        }, {
            offset: 1,
            color: '#ddd',
        }]
    }]
}

2. UnimChart -> ClientEvents -> ExtEvents -> Ext.chart.CartesianChart[chart] -> function chart.painted:

function chart.painted(sender, eOpts)
{
    var me=this;
    // for UnimAreaSeries1
    me.getSeries()[0].sprites[0].setAttributes({fillStyle: 'url(#gradientId1)'});
    me.getSeries()[0]._style.fillStyle='url(#gradientId1)';

    // for UnimAreaSeries2
    me.getSeries()[1].sprites[0].setAttributes({fillStyle: 'url(#gradientId2)'});
    me.getSeries()[1]._style.fillStyle='url(#gradientId2)';
}

post-906-0-34154000-1485506371_thumb.png

 

* still need to change the color of the legend too, but at the moment it can be done with Brush.Color

 

Try,

 

Best regards.

×
×
  • Create New...