NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Google provide service to draw briliant charts
      http://code.google.com/intl/ru-RU/apis/chart/

      I'we tried to use it in Confluence
      I put inside

      {HTML}

      HTML example from
      http://code.google.com/intl/ru-RU/apis/chart/interactive/docs/quick_start.html
      and got nothing

      But if I open page in Preview mode - chart appearing.

      What wrong with google chart inside HTML macros ?

            [CONFSERVER-23105] Google Chart does not work in HTML macro

            Andreas Weber added a comment - - edited

            I've tested it with Confluence 4.1.7 and the latest Chrome 18 beta and both preview and saving worked.

            Andreas Weber added a comment - - edited I've tested it with Confluence 4.1.7 and the latest Chrome 18 beta and both preview and saving worked.

            Anatoli added a comment -

            Tested against the latest confluence on FF and it worked: http://screencast.com/t/DbycV4l2dZ . There was still a problem with preview on FF.
            With chrome it is vise-verse preview worked and saving didn't.

            In general case inside html macro you can put anything including things that can conflict with the existing js/html on the page. So we cannot guarantee that content of html macro will render as expected. For this particular case a dedicated macro (plugin) would be the right solution.

            Anatoli added a comment - Tested against the latest confluence on FF and it worked: http://screencast.com/t/DbycV4l2dZ . There was still a problem with preview on FF. With chrome it is vise-verse preview worked and saving didn't. In general case inside html macro you can put anything including things that can conflict with the existing js/html on the page. So we cannot guarantee that content of html macro will render as expected. For this particular case a dedicated macro (plugin) would be the right solution.

            We are being affected by the same bug in the version of Confluence we use for our company (v.3.5.11)

            We simply cannot use Google charts or Google chart API inside Confluence pages.

            Could you please provide a fix for this. Maybe, at least, in a dedicated macro ?

            Yassine TRAD added a comment - We are being affected by the same bug in the version of Confluence we use for our company (v.3.5.11) We simply cannot use Google charts or Google chart API inside Confluence pages. Could you please provide a fix for this. Maybe, at least, in a dedicated macro ?

            It seems like the problem is in Object.extend._each() at legacy.confluence.web.resources:prototype.js:1

            but i'm not quite sure bc google provides obfuscated code for embedding.

            This is a trace of exception that I got before message "undefined is not a function" appear instead of embedded chart.

            (anonymous function)() at format+ru,default,corechart.I.js:496
            Ju() at format+ru,default,corechart.I.js:497
            Iu() at format+ru,default,corechart.I.js:496
            (anonymous function)() at format+ru,default,corechart.I.js:673
            (anonymous function)() at legacy.confluence.web.resources:prototype.js:1
            (anonymous function)() at legacy.confluence.web.resources:prototype.js:1
            Object.extend._each() at legacy.confluence.web.resources:prototype.js:1
            Enumerable.each() at legacy.confluence.web.resources:prototype.js:1
            Enumerable.collect() at legacy.confluence.web.resources:prototype.js:1
            Kp.map.d() at format+ru,default,corechart.I.js:382
            V.Is() at format+ru,default,corechart.I.js:673
            V.as() at format+ru,default,corechart.I.js:672
            V.xj() at format+ru,default,corechart.I.js:705
            sx() at format+ru,default,corechart.I.js:704
            V.pt() at format+ru,default,corechart.I.js:776
            Z() at format+ru,default,corechart.I.js:377
            (anonymous function)() at format+ru,default,corechart.I.js:484
            Z() at format+ru,default,corechart.I.js:377
            bu() at format+ru,default,corechart.I.js:486
            V.Og() at format+ru,default,corechart.I.js:484
            V.draw() at format+ru,default,corechart.I.js:774
            V.Xk() at format+ru,default,corechart.I.js:786
            V.draw() at format+ru,default,corechart.I.js:783
            V.up() at format+ru,default,corechart.I.js:783
            V.draw() at format+ru,default,corechart.I.js:783
            drawMyChart() at test:1111
            

            Maxim Chechel added a comment - It seems like the problem is in Object.extend._each() at legacy.confluence.web.resources:prototype.js:1 but i'm not quite sure bc google provides obfuscated code for embedding. This is a trace of exception that I got before message "undefined is not a function" appear instead of embedded chart. (anonymous function)() at format+ru, default ,corechart.I.js:496 Ju() at format+ru, default ,corechart.I.js:497 Iu() at format+ru, default ,corechart.I.js:496 (anonymous function)() at format+ru, default ,corechart.I.js:673 (anonymous function)() at legacy.confluence.web.resources:prototype.js:1 (anonymous function)() at legacy.confluence.web.resources:prototype.js:1 Object .extend._each() at legacy.confluence.web.resources:prototype.js:1 Enumerable.each() at legacy.confluence.web.resources:prototype.js:1 Enumerable.collect() at legacy.confluence.web.resources:prototype.js:1 Kp.map.d() at format+ru, default ,corechart.I.js:382 V.Is() at format+ru, default ,corechart.I.js:673 V.as() at format+ru, default ,corechart.I.js:672 V.xj() at format+ru, default ,corechart.I.js:705 sx() at format+ru, default ,corechart.I.js:704 V.pt() at format+ru, default ,corechart.I.js:776 Z() at format+ru, default ,corechart.I.js:377 (anonymous function)() at format+ru, default ,corechart.I.js:484 Z() at format+ru, default ,corechart.I.js:377 bu() at format+ru, default ,corechart.I.js:486 V.Og() at format+ru, default ,corechart.I.js:484 V.draw() at format+ru, default ,corechart.I.js:774 V.Xk() at format+ru, default ,corechart.I.js:786 V.draw() at format+ru, default ,corechart.I.js:783 V.up() at format+ru, default ,corechart.I.js:783 V.draw() at format+ru, default ,corechart.I.js:783 drawMyChart() at test:1111

            Alan O'Dea added a comment -

            I'm getting the same error having the ability to drop in-line Google charts would make Confluence very powerful.

            Alan O'Dea added a comment - I'm getting the same error having the ability to drop in-line Google charts would make Confluence very powerful.

            Here is content of my page.
            It's draw chart in preview mode, but draw nothing when browsed after been saved

            {html}
            
                <script type="text/javascript" src="https://www.google.com/jsapi"></script>
                <script type="text/javascript">
                
                  // Load the Visualization API and the piechart package.
                  google.load('visualization', '1.0', {'packages':['corechart']});
                  
                  // Set a callback to run when the Google Visualization API is loaded.
                  google.setOnLoadCallback(drawChart);
                  
                  // Callback that creates and populates a data table, 
                  // instantiates the pie chart, passes in the data and
                  // draws it.
                  function drawChart() {
            
                  // Create the data table.
                  var data = new google.visualization.DataTable();
                  data.addColumn('string', 'Topping');
                  data.addColumn('number', 'Slices');
                  data.addRows([
                    ['Mushrooms', 3],
                    ['Onions', 1],
                    ['Olives', 1], 
                    ['Zucchini', 1],
                    ['Pepperoni', 2]
                  ]);
            
                  // Set chart options
                  var options = {'title':'How Much Pizza I Ate Last Night',
                                 'width':400,
                                 'height':300};
            
                  // Instantiate and draw our chart, passing in some options.
                  var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
                  chart.draw(data, options);
                }
                </script>
            
            
                <div id="chart_div"></div>
            {html} 
            

            Alexander Korolev added a comment - Here is content of my page. It's draw chart in preview mode, but draw nothing when browsed after been saved {html} <script type= "text/javascript" src= "https: //www.google.com/jsapi" ></script> <script type= "text/javascript" > // Load the Visualization API and the piechart package . google.load( 'visualization' , '1.0' , { 'packages' :[ 'corechart' ]}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() { // Create the data table. var data = new google.visualization.DataTable(); data.addColumn( 'string' , 'Topping' ); data.addColumn( 'number' , 'Slices' ); data.addRows([ [ 'Mushrooms' , 3], [ 'Onions' , 1], [ 'Olives' , 1], [ 'Zucchini' , 1], [ 'Pepperoni' , 2] ]); // Set chart options var options = { 'title' : 'How Much Pizza I Ate Last Night' , 'width' :400, 'height' :300}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.PieChart(document.getElementById( 'chart_div' )); chart.draw(data, options); } </script> <div id= "chart_div" ></div> {html}

            BillA added a comment -

            Hi Alexander, please provide steps for reproducing including the html content you're trying to insert.

            BillA added a comment - Hi Alexander, please provide steps for reproducing including the html content you're trying to insert.

              Unassigned Unassigned
              c8d46d52f338 Alexander Korolev
              Affected customers:
              1 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: