jQuery UI Widgets Forums Chart jqxTooltip and jqxDraw

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Sloth 9 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • jqxTooltip and jqxDraw #82235

    Peter Sloth
    Participant

    Hi

    I have some code which generates a series of shapes. The metadata which is used to generate the shapes contains additional information about each shape. I would like to show this information as a tooltip for each shape.
    Is this at all possible? If yes, I would very much like to know how!

    thanks

    //Peter

    jqxTooltip and jqxDraw #82247

    Dimitar
    Participant

    Hi Peter,

    Here is an example showing how to initialize a jqxTooltip from an SVG element plotted with jqxDraw. We hope it is helpful to you:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxdraw.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script>
        <script type="text/javascript">
            $(document).ready(function ()
            {
                $('#container').jqxDraw();
    
                var renderer = $('#container').jqxDraw('getInstance');
                var size = renderer.getSize();
    
                var borderElement = renderer.rect(0, 0, size.width, size.height, { stroke: '#777777', fill: 'transparent' });
    
                var circleUp = renderer.circle(50, 150, 30, { fill: '#DEDEDE', stroke: '#777777' });
    
                $(circleUp).jqxTooltip({ content: 'SVG circle', position: 'mouse' });
    
                renderer.refresh();
            });
        </script>
    </head>
    <body class='default'>
        <div id='container' style="width: 250px; height: 250px">
        </div>
    </body>
    </html>

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    jqxTooltip and jqxDraw #82288

    Peter Sloth
    Participant

    Hi Dimitar

    thanks, it works perfectly:-)

    Best regards
    Peter

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.