svgdojogaugedojox.gfx

Adding title text inside gauge Dojo


i need to insert a title (not a tooltip, a text on the top) inside the svg rendered by Dojo. How can i do that?

Here my Dgauge: http://jsfiddle.net/MacroX/pZU93/1/

PD: The line

gauge.title = 'Test Report'

doesnt show the title


Solution

  • Finally i got a way to resolve this, and this is useful when you need to personalize your dgauge. Here the example: http://jsfiddle.net/MacroX/THJqV/

    What i did is basicly create a gauge, fill it with background white, and then add elements inside

    var baseWidth = 400;
    gauge.addElement("background", function (g) {
        var auxHeight = baseWidth * objGauge.offsetHeight / objGauge.offsetWidth;
        g.createRect({
            width: 400, height: auxHeight
            //width: 400, height: 300
        }).setFill("#FFF");
    });
    

    I dont know if is the best way, but works and i didnt find something similar in other sites

    And what I think is great, this support multiple chart dgauges in only one SVG

    I hope this will useful to someone else