Can the SVG Bar chart have a watermark image?
Posted by watermark in bar chart on 09:36 19th February 2021
can we add watermark in SVG Bar chart ? diagonally ?
Posted by Richard on 12:53 19th February 2021
Hi,
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?
Cheers.
Richard
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?
Cheers.
Richard