rgraph

How to change the background to gradient using Rgraph open source tool


Anyone have an example of how to set the background to appear as a gradient in Rgraph? Something like this :

http://support.softwarefx.com/JavaAPI/CfxJava65_api/SoftwareFX/ChartFX/images/GradientBackgroundObject.png

Thanks


Solution

  • This was answered in the RGraph forum today:

    [Formerly there was just a link, but here's some sample code instead]

    new RGraph.Bar({
        id: 'cvs',
        data: [6,8,6],
        options: {
            colors: ['#888'],
            backgroundColor: 'Gradient(white:purple)',
            backgroundGrid: false,
            marginInner: 80
        }
    }).draw();