[RGRAPH SUPPORT] Can the SVG Bar chart have a watermark image?

Can the SVG Bar chart have a watermark image?

Post a reply
Posted by watermark in bar chart at 09:36 on 19th February 2021
can we add watermark in SVG Bar chart ? diagonally ?

Posted by Richard at 12:53 on 19th February 2021
You can add a background image like this:

bar = new RGraph.SVG.Bar({
    id: 'cc',
    data: [5,9,6,3,2,6,7],
    options: {
        marginInner: 20,
        xaxisLabels: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],
        backgroundGridVlines: false,
        backgroundGridBorder: false,
        xaxis: false,
        yaxis: false,
        backgroundImage: '/images/logo.png',
        backgroundImageStretch: false,
        backgroundImageX: 35,
        backgroundImageY: 35,
        backgroundImageW: 64,
        backgroundImageH: 64,
    }
}).draw();

// Rotate the image 45 degrees about the coordinates (67,67)
bar.svg.all.getElementsByTagName('image')[0].setAttribute('transform','rotate(45 67 67)');

Is that the sort of thing you wanted?

Post a reply

What's your name?
What do you want to say?