SVG Panel + SQL Server query

Hi,
I should do a svg project which displays data from a query (SQL Server).
To start I’m trying to put a query value in a cell but I don’t know how to do it.

Can anyone assist me?
Thanks
Valentina

which SVG panel plugin? There are a few, but all community-built I believe

image

your data as the documentation indicates will be found in the ctrl.
Add the following to your code and you will see the content of the data you are looking for

var s = Snap(svgnode);
console.log('Hard to Grok this vsg thing', ctrl)

and here it is in the console. it reappears every time you change a piece of code

var s = Snap(svgnode);
var tot = ctrl.data[0].rows[0].Tot;
buildRectangle();

      
function buildRectangle() {
    
   var rect = s.rect(10,10,150,150);
    rect.attr({fill: "#bada12"})
    var text = s.text(50, 135, "T1:" + tot.toString())
    text.attr({
          'font-size':25,
          'fill': "#bada2"
      });
}

function buildCircle() {
    var bigCircle = s.circle(150, 109, 110);
    bigCircle.attr({
        fill: "#bada55",
        stroke: "#000",
        strokeWidth: 5
    });
    
}

image

1 Like