0 Replies Latest reply: Mar 24, 2013 3:35 PM by Birthe RSS

    Display Gauge with javascript

    Birthe
      Dear all,

      I am trying the new Apex version and have a problem with anychart and javascript. My example is very simple and displays an empty gauge.

      I have created two PLSQL regions, one for the XML part and the second for the javascript part.

      XML Region Source
      begin
      --style="display:none"
      
        htp.p('
       <textarea cols="100" rows="10" id="GaugeXML"  >
      <?xml version="1.0" encoding="UTF-8"?>
      <anychart>
        <gauges>
          <gauge>
            <circular />
          </gauge>
        </gauges>
      </anychart>
       </textarea>
      ');
      end;
      Javascript region source
      begin
      
      htp.p('
      
       <div id="GaugeDiv">Display Gauge...</div>
      
       <script type="text/javascript">
      
        //Set variable
        var chart;
        var xml_data
       
      
        // Create new gantt chart 
        //AnyChart.renderingType = anychart.RenderingType.SVG_ONLY;
        chart = new AnyChart("/i/flashchart/anygantt_6/swf/OracleAnyChart.swf");
        chart.width="500";
        chart.height="200";
        
        // Get string data from text area 
        xml_data = document.getElementById("GaugeXML").value.toString();
        
        // Set data 
        chart.setData(xml_data);
        
        // Write chart to "chart" div 
        chart.write("GaugeDiv");
      
       </script>
      
      ');
      
      end;
      Region Header
      <script type="text/javascript" src="/i/flashchart/anychart_6/js/AnyChart.js"></script>
      <script type="text/javascript" src="/i/flashchart/anychart_6/js/AnyChartHTML5.js"></script>
      Unfortunatly the gauge is not displaying.

      Have someone an idea?

      Thanks for your help.

      brgds,
      Birthe