Rgraph svg chart in Appcelerator does not fire the click event

66 views Asked by At

I recently updated Rgraph in my Appcelerator project, and I got a problem: the onclick function does not work. Here is a sample code:

head:

    <pre class="code">
        
        <script src="rgraph/RGraph.svg.common.core.js"></script>            
        <script src="rgraph/RGraph.svg.common.tooltips.js"></script>
        <script src="rgraph/RGraph.svg.pie.js"></script>                  
    </pre>    

end head

<body>
           
     <div style="width: 700px; height: 350px; border: 1px solid #ddd" id="chart-container"> </div>
    <script>
        Ti.API.info('test 1 '); 
    </script>

     <script>
                    
      var torta = new RGraph.SVG.Pie({
            id: 'chart-container',
            data: [70,30],              
            options: {                  
                labels: ['first', 'second'],
                tooltips: ['tool0','tool1'],                    
                shadow: true,
                exploded: [0,25],
                colors: ['red','yellow']                    
            }
       }).on('click', function (e, shape){
                
            Ti.API.info('test 2');
            
        });
        
        torta.roundRobin();
        
    
    </script>
</body>

The tooltips show up regulary, and I can see "test 1" in the console when the chart is drawed, but I can't see "test 2" when I click the chart. I'm testing it with the iPad 8 emulator, with ios 14 and Titanium sdk 9.2.2. Can anyone help me? Thanks

0

There are 0 answers