{"id":51779,"date":"2021-02-26T03:01:00","date_gmt":"2021-02-25T17:01:00","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=51779"},"modified":"2021-02-26T09:32:36","modified_gmt":"2021-02-25T23:32:36","slug":"google-chart-histogram-chart-pie-chart-html-tooltips-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-html-tooltips-tutorial\/","title":{"rendered":"Google Chart Histogram Chart Pie Chart HTML Tooltips Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Histogram Chart Pie Chart HTML Tooltips Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/pie_chart_interface_tooltip_html.jpg\" title=\"Google Chart Histogram Chart Pie Chart HTML Tooltips Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Histogram Chart Pie Chart HTML Tooltips Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Google Chart Histogram Chart Pie Chart Tooltips Tutorial' href='#gchcpctt'>Google Chart Histogram Chart Pie Chart Tooltips Tutorial<\/a> got us going with tooltips, but with a limited &#8220;just text&#8221; feel to them, but if you have done some <a target=_blank title='Google Charts tooltips information' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/customizing_tooltip_content'>Google Charts tooltip<\/a> research <font color=blue>you&#8217;ll know<\/font> the &#8230;<\/p>\n<p><code><br \/>\ntooltip: { trigger: 'both', <font color=blue>isHtml: true<\/font> }<br \/>\n<\/code><\/p>\n<p> &#8230; option opens the door to a whole lot more, and today we start showing within the Pie Chart tooltip an HTML iframe whose src attribute points back at the calling Histogram Chart, completing that &#8220;reconstruction circle&#8221; started yesterday.<\/p>\n<p>These tooltips now occupy so much more &#8220;data space&#8221;, and so for these scenarios we use HTML form method=POST navigational arrangements, being that we are using serverside PHP web applications here &#8230;<\/p>\n<table>\n<tr>\n<th>HTML form (Histogram Chart)<\/th>\n<\/tr>\n<tr>\n<td>\n<code><br \/>\n&lt;form target=_blank id=mypieform action='\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php' method='POST' style='display:none;'&gt;<br \/>\n&lt;input type=hidden name=title value='' id=mypietitle&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=onclick value='y' id=mypieonclick&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=country value='' id=mypiecountry&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=popularity value='' id=mypiepopularity&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=r value='' id=mypier&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=c value='' id=mypiec&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=desc value='' id=mypiedesc&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=task value='' id=mypietask&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=data value='' id=mypiedata&gt;&lt;\/input&gt;<br \/>\n&lt;input type=submit value=Go style=display:none; id=mypiego&gt;&lt;\/input&gt;<br \/>\n&lt;\/form&gt;<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<tr>\n<th>PHP <font color=blue>changes regarding this form<\/font> (Histogram Chart)<\/th>\n<\/tr>\n<tr>\n<td>\n<code><br \/>\n   function infillit(urltgo) {<br \/>\n     var pbitsare=decodeURIComponent(paramdata).split('~,'), iminis=0, imaxis=0, cntsare=[];<br \/>\n     var ustg=urltgo.split('[%27');<br \/>\n     var totnum=eval(-1 + eval('' + pbitsare.length));<br \/>\n     var iut=0, jut=0;<br \/>\n     utgo=urltgo;<br \/>\n     if (tts.length &gt; 0) {<br \/>\n     if (tts[0] == '') {<br \/>\n<br \/> <br \/>\n     for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n        iminis=eval('' + ustg[jut].split('%20')[0]);<br \/>\n        imaxis=-1;<br \/>\n        if (ustg[jut].indexOf('%20to%20') != -1) { imaxis=eval('' + ustg[jut].split('%20to%20')[1].split(',')[0]); }<br \/>\n        cntsare.push(eval('' + ustg[jut].split(',')[1].split(']')[0]));<br \/>\n<br \/> <br \/>\n      if (jut == 1) {<br \/>\n        <font color=blue>tts[0]=',' + String.fromCharCode(34) + '&lt;P onmouseover=console.log(54);&gt;Count: ' + cntsare[eval(-1 + jut)] + ' (' + eval(eval(eval('' + cntsare[eval(-1 + jut)]) * 100) \/ totnum).toFixed(1) + '%) &lt;\/P&gt;' + String.fromCharCode(34);<\/font><br \/>\n      } else {<br \/>\n        <font color=blue>tts.push(',' + String.fromCharCode(34) + '&lt;P onmouseover=console.log(354);&gt;Count: ' + cntsare[eval(-1 + jut)] + ' (' + eval(eval(eval('' + cntsare[eval(-1 + jut)]) * 100) \/ totnum).toFixed(1) + '%) &lt;\/P&gt;' + String.fromCharCode(34));<\/font><br \/>\n      }<br \/>\n<br \/> <br \/>\n     }<br \/>\n<br \/> <br \/>\n     for (iut=1; iut&lt;pbitsare.length; iut++) {<br \/>\n      for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n        iminis=eval('' + ustg[jut].split('%20')[0]);<br \/>\n        imaxis=-1;<br \/>\n        if (ustg[jut].indexOf('%20to%20') != -1) { imaxis=eval('' + ustg[jut].split('%20to%20')[1].split(',')[0]); }<br \/>\n        if (eval('' + pbitsare[iut].split(']')[0].replace('+','')) &gt;= eval('' + iminis) && (('' + imaxis) == '-1' || eval('' + pbitsare[iut].split(']')[0].replace('+','')) &lt;= eval('' + imaxis))) {<br \/>\n        if (tts[eval(-1 + jut)].indexOf(' made ') == -1) {<br \/>\n          <font color=blue>tts[eval(-1 + jut)]=tts[eval(-1 + jut)].replace(' &lt;\/P&gt;',  ' made up of &lt;a target=_blank title=Histogram href=' + document.URL + '&gt;' + pbitsare[iut].split(']')[0].replace('+','') + ' &lt;\/P&gt;');<\/font><br \/>\n        } else {<br \/>\n          <font color=blue>tts[eval(-1 + jut)]=tts[eval(-1 + jut)].replace(' &lt;\/P&gt;', ' ' + pbitsare[iut].split(']')[0].replace('+','') + ' &lt;\/P&gt;');<br \/>\n        }<br \/>\n        }<br \/>\n      }<br \/>\n     }<br \/>\n<br \/> <br \/>\n     for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n       <font color=blue>if (tts[eval(-1 + jut)].indexOf('&lt;a') != -1) { tts[eval(-1 + jut)]=tts[eval(-1 + jut)].replace(' &lt;\/P&gt;', '&lt;\/a&gt;&lt;br&gt;&lt;style&gt; iframe { transform:scale(0.5);transform-origin:0px 0px; } &lt;\/style&gt;&lt;iframe src=' + document.URL + ' style=width:800px;height:800px;&gt;&lt;\/iframe&gt;&lt;\/P&gt;');  }<\/font><br \/>\n       if (eval('' + tts.length) &gt;= jut) {<br \/>\n         utgo=utgo.replace(ustg[jut], ustg[jut].replace(',', ',' + String.fromCharCode(34) + encodeURIComponent(tts[eval(-1 + jut)].substring(2,eval(-1 + tts[eval(-1 + jut)].length))) + String.fromCharCode(34) + ','));<br \/>\n       }<br \/>\n     }<br \/>\n     utgo=utgo.replace(\/\\]\\,\\[\/g, ']%20,%20[').replace(\/\\,\\[\/g, ',%20[').replace(\/\\[\\%27\/g,'[~').replace(\/\\%27\\,\/g,'~,');<br \/>\n     tts=[''];<br \/>\n<br \/> <br \/>\n     }<br \/>\n     }<br \/>\n<br \/> <br \/>\n     return utgo;<br \/>\n   }<br \/>\n<br \/>\n   function maybeothers(urltogo, ansistogo) {<br \/>\n     if (ansistogo.substring(0,1).toLowerCase() == 'p') {<br \/>\n       var returl=infillit(urltogo.replace(\/\\'\/g,'%27').replace(\/\\ \/g,'%20'));<br \/>\n       <font color=blue>if (eval('' + returl.length) &gt; 900) {<br \/>\n          if (returl.indexOf('title=') != -1) {<br \/>\n          document.getElementById('mypietitle').value=decodeURIComponent(returl.split('title=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          }<br \/>\n          if (returl.indexOf('country=') != -1) {<br \/>\n          document.getElementById('mypiecountry').value=decodeURIComponent(returl.split('country=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          document.getElementById('mypietask').value=decodeURIComponent(returl.split('country=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          }<br \/>\n          if (returl.indexOf('popularity=') != -1) {<br \/>\n          document.getElementById('mypiepopularity').value=decodeURIComponent(returl.split('popularity=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          document.getElementById('mypiedesc').value=decodeURIComponent(returl.split('popularity=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          }<br \/>\n          if (returl.indexOf('&r=') != -1) {<br \/>\n          document.getElementById('mypier').value='1'; \/\/decodeURIComponent(returl.split('&r=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          }<br \/>\n          if (returl.indexOf('&c=') != -1) {<br \/>\n          document.getElementById('mypiec').value='1'; \/\/decodeURIComponent(returl.split('&c=')[1].split('&')[0]).replace(\/\\+\/g,' ');<br \/>\n          }<br \/>\n          if (returl.indexOf('data=') != -1) {<br \/>\n          document.getElementById('mypiedata').value=decodeURIComponent(returl.split('data=')[1].split('&')[0]);<br \/>\n          }<br \/>\n          \/\/alert(document.getElementById('mypieform').innerHTML);<br \/>\n          document.getElementById('mypiego').click();<br \/>\n          return '';<br \/>\n       } else {<\/font><br \/>\n          return returl;<br \/>\n       <font color=blue>}<\/font><br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'c') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'l') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'b') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'a') {<br \/>\n     }<br \/>\n     return urltogo.replace(\/\\'\/g,'%27').replace(\/\\ \/g,'%20');<br \/>\n   }<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<\/table>\n<p><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php----------GETME\" title=\"histogram_chart.php\" target=\"_blank\">The changed<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php----------GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\" title=\"histogram_chart.php\" target=\"_blank\">Histogram Chart<\/a> can interface to <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php--------------------GETME\" title=\"pie_chart.php\" target=\"_blank\">the changed<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php--------------------GETME\" title=\"pie_chart.php\" target=\"_blank\">pie_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php\" title=\"pie_chart.php\" target=\"_blank\">Pie Chart<\/a>, and say &#8230;<\/p>\n<blockquote><p>\nHere&#8217;s looking at you, kid.\n<\/p><\/blockquote>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-html-tooltips-tutorial\/'>Google Chart Histogram Chart Pie Chart HTML Tooltips Tutorial<\/a>.<\/p-->\n<hr>\n<p id='gchcpctt'>Previous relevant <a target=_blank title='Google Chart Histogram Chart Pie Chart Tooltips Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-tooltips-tutorial\/'>Google Chart Histogram Chart Pie Chart Tooltips Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Histogram Chart Pie Chart Tooltips Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/pie_chart_interface_tooltip.jpg\" title=\"Google Chart Histogram Chart Pie Chart Tooltips Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Histogram Chart Pie Chart Tooltips Tutorial<\/p><\/div>\n<p>The interface between <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Charts<\/a> <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>Histogram Chart<\/a> interfaces to <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart' title='Pie Chart'>Pie Chart<\/a> lost &#8220;data intelligence&#8221; that we want to pass on to the Pie Chart today.<\/p>\n<p>The mechanism by which we pass this list of Histogram data points (that go to make up the data source behind the svg graphics in the Histogram Chart) is via a Pie Chart&#8217;s <a target=_blank title='Google Charts tooltips information' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/customizing_tooltip_content'>tooltip<\/a> capabilities &#8230;<\/p>\n<blockquote cite='https:\/\/developers.google.com\/chart\/interactive\/docs\/customizing_tooltip_content'><p>\nTooltips are the little boxes that pop up when you hover over something. (Hovercards are more general, and can appear anywhere on the screen; tooltips are always attached to something, like a dot on a scatter chart, or a bar on a bar chart.)\n<\/p><\/blockquote>\n<p>By doing <font color=blue>the changes<\/font> below for tooltips (in <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php---------GETME\" title=\"histogram_chart.php\" target=\"_blank\">the changed<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php---------GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a>), further to <a title='Google Chart Histogram Chart Pie Chart Interface Tutorial' href='#gchcpcit'>Google Chart Histogram Chart Pie Chart Interface Tutorial<\/a>, in the interfaced to Pie Charts &#8230;<\/p>\n<p><code><br \/>\n   function analyzesvg(svgsisvgsinnerHTML) {<br \/>\n      \/\/ ... jump to end of function below ...<br \/>\n              var dbits=lh.split('&data=');<br \/>\n              var urlgo=dbits[0].replace('\/HistogramChart', '\/PieChart').replace('histogram_chart.php', 'pie_chart.php').replace('&task=','&country=').replace('&desc=','&popularity=') + '&desc=' + teledata;<br \/>\n              if (urlgo.indexOf('title=&country=&onclick=y&popularity=&desc=&') != -1) {<br \/>\n                urlgo=urlgo.replace('&popularity=&', '&popularity=' + '\" . ('' . $_POST['desc']) . \"&').replace('&country=&', '&country=' + '\" . ('' . $_POST['task']) . \"&').replace('title=&', 'title=' + '\" . ('' . $_POST['title']) . \"&');<br \/>\n              }<br \/>\n              if (oblurb != null) {<br \/>\n              ohref=<font color=blue>maybeothers<\/font>(urlgo,ans.substring(0,1).toLowerCase());<br \/>\n              window.open(ohref,'_blank','top=20,left=20,width=800,height=660');<br \/>\n              } else {<br \/>\n              ohref=<font color=blue>maybeothers<\/font>(urlgo,ans.substring(0,1).toLowerCase());<br \/>\n              location.href=ohref;<br \/>\n              }<br \/>\n             } else if (pardata == '') {<br \/>\n              location.href=document.URL + '?title=\" . urlencode(str_replace(\",\",\"`\",$GETtitle)) . '&task=' . urlencode($GETtask) . '&onclick=y&desc=' . urlencode($GETdesc) . \"&data=' + ourencodeURIComponent(ans);<br \/>\n             } else {<br \/>\n              location.href=document.URL.replace(pardata, ourencodeURIComponent(ans));<br \/>\n             }<br \/>\n            }<br \/>\n   }<br \/>\n<br \/> <br \/>\n   <font color=blue>function infillit(urltgo) {<br \/>\n     var pbitsare=decodeURIComponent(paramdata).split('~,'), iminis=0, imaxis=0, cntsare=[];<br \/>\n     var ustg=urltgo.split('[%27');<br \/>\n     var totnum=eval(-1 + eval('' + pbitsare.length));<br \/>\n     var iut=0, jut=0;<br \/>\n     utgo=urltgo;<br \/>\n     if (tts.length &gt; 0) {<br \/>\n     if (tts[0] == '') {<br \/>\n<br \/> <br \/>\n     for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n        iminis=eval('' + ustg[jut].split('%20')[0]);<br \/>\n        imaxis=-1;<br \/>\n        if (ustg[jut].indexOf('%20to%20') != -1) { imaxis=eval('' + ustg[jut].split('%20to%20')[1].split(',')[0]); }<br \/>\n        cntsare.push(eval('' + ustg[jut].split(',')[1].split(']')[0]));<br \/>\n<br \/> <br \/>\n      if (jut == 1) {<br \/>\n        tts[0]=',' + String.fromCharCode(34) + 'Count: ' + cntsare[eval(-1 + jut)] + ' (' + eval(eval(eval('' + cntsare[eval(-1 + jut)]) * 100) \/ totnum).toFixed(1) + '%) ' + String.fromCharCode(34);<br \/>\n      } else {<br \/>\n        tts.push(',' + String.fromCharCode(34) + 'Count: ' + cntsare[eval(-1 + jut)] + ' (' + eval(eval(eval('' + cntsare[eval(-1 + jut)]) * 100) \/ totnum).toFixed(1) + '%) ' + String.fromCharCode(34));<br \/>\n      }<br \/>\n<br \/> <br \/>\n     }<br \/>\n<br \/> <br \/>\n     for (iut=1; iut&lt;pbitsare.length; iut++) {<br \/>\n      for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n        iminis=eval('' + ustg[jut].split('%20')[0]);<br \/>\n        imaxis=-1;<br \/>\n        if (ustg[jut].indexOf('%20to%20') != -1) { imaxis=eval('' + ustg[jut].split('%20to%20')[1].split(',')[0]); }<br \/>\n        if (eval('' + pbitsare[iut].split(']')[0].replace('+','')) &gt;= eval('' + iminis) && (('' + imaxis) == '-1' || eval('' + pbitsare[iut].split(']')[0].replace('+','')) &lt;= eval('' + imaxis))) {<br \/>\n        if (tts[eval(-1 + jut)].indexOf(' made ') == -1) {<br \/>\n          tts[eval(-1 + jut)]=tts[eval(-1 + jut)].replace(' ' + String.fromCharCode(34),  ' made up of ' + pbitsare[iut].split(']')[0].replace('+','') + ' ' + pbitsare[iut].split(']')[0].replace('+','') + ' ' + String.fromCharCode(34));<br \/>\n        } else {<br \/>\n          tts[eval(-1 + jut)]=tts[eval(-1 + jut)].replace(' ' + String.fromCharCode(34), ' ' + pbitsare[iut].split(']')[0].replace('+','') + ' ' + String.fromCharCode(34));<br \/>\n        }<br \/>\n        }<br \/>\n      }<br \/>\n     }<br \/>\n<br \/> <br \/>\n     for (jut=1; jut&lt;ustg.length; jut++) {<br \/>\n       if (eval('' + tts.length) &gt;= jut) {<br \/>\n         utgo=utgo.replace(ustg[jut], ustg[jut].replace(',', ',' + String.fromCharCode(34) + encodeURIComponent(tts[eval(-1 + jut)].substring(2,eval(-3 + tts[eval(-1 + jut)].length))) + String.fromCharCode(34) + ','));<br \/>\n       }<br \/>\n     }<br \/>\n     utgo=utgo.replace(\/\\]\\,\\[\/g, ']%20,%20[').replace(\/\\,\\[\/g, ',%20[').replace(\/\\[\\%27\/g,'[~').replace(\/\\%27\\,\/g,'~,');<br \/>\n     tts=[''];<br \/>\n<br \/> <br \/>\n     }<br \/>\n     }<br \/>\n<br \/> <br \/>\n     return utgo;<br \/>\n   }<br \/>\n<br \/> <br \/>\n   function maybeothers(urltogo, ansistogo) {<br \/>\n     if (ansistogo.substring(0,1).toLowerCase() == 'p') {<br \/>\n       return infillit(urltogo.replace(\/\\'\/g,'%27').replace(\/\\ \/g,'%20'));<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'c') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'l') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'b') {<br \/>\n     } else if (ansistogo.substring(0,1).toLowerCase() == 'a') {<br \/>\n     }<br \/>\n     return urltogo.replace(\/\\'\/g,'%27').replace(\/\\ \/g,'%20');<br \/>\n   }<\/font><br \/>\n<\/code><\/p>\n<p> &#8230; we make it so that to look at Pie Chart you could reconstruct the Histogram behind the scenes, as you can try in yesterday&#8217;s posting.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-tooltips-tutorial\/'>Google Chart Histogram Chart Pie Chart Tooltips Tutorial<\/a>.<\/p-->\n<hr>\n<p id='gchcpcit'>Previous relevant <a target=_blank title='Google Chart Histogram Chart Pie Chart Interface Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-interface-tutorial\/'>Google Chart Histogram Chart Pie Chart Interface Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Histogram Chart Pie Chart Interface Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/pie_chart_interface.jpg\" title=\"Google Chart Histogram Chart Pie Chart Interface Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Histogram Chart Pie Chart Interface Tutorial<\/p><\/div>\n<p>When we presented <a title='Google Chart Histogram Chart Select Event Synergy Tutorial' href='#gchcsest'>Google Chart Histogram Chart Select Event Synergy Tutorial<\/a> it represented a <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Charts<\/a> &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>Histogram Chart<\/a> interfaces to <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart' title='Pie Chart'>Pie Chart<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; tool.  Recently, we revisited the interface (from Histogram &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Roll of a Die' href='http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php?title=Roll+of+the+die&#038;onclick=y&#038;task=Roll&#038;desc=Score&#038;r=13&#038;c=1&#038;data=%2C%5B%7EThree%7E%2C+3%5D%2C%5B%7EFour%7E%2C+4%5D%2C%5B%7EFour%7E%2C+4%5D%2C%5B%7EThree%7E%2C+3%5D%2C%5B%7EFive%7E%2C+5%5D%2C%5B%7EFour%7E%2C+4%5D%2C%5B%7EFive%7E%2C+5%5D%2C%5B%7EFour%7E%2C+4%5D%2C%5B%7EFive%7E%2C+5%5D%2C%5B%7ESix%7E%2C+6%5D%2C%5B%7EOne%7E%2C+1%5D%2C%5B%7EOne%7E%2C+1%5D%2C%5B%7ETwo%7E%2C+2%5D%2C%5B%7EThree%7E%2C+3%5D'>Roll of a Die Histogram Chart<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; Chart) aspects to these arrangements, via that menu which appears when you click a rectangle of the Histogram, and found that it ended in a blank Pie Chart (ie. no chart shows) you can simulate via &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Troublesome Pie Chart' href='http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php?title=&#038;country=&#038;onclick=y&#038;popularity=&#038;desc=%20&#038;data=%20,[%270%20to%201%27,0]%20,[%272%20to%203%27,0]%20,[%274%20to%205%27,0]%20,[%276%20to%207%27,0]%20,[%278%20and%20up%27,0]'>Click to see the Pie Chart you have when you are not having a Pie Chart<\/a><br \/>\n<\/code> <\/p>\n<p>Believe it or not, to go from the look of above to the better look (and result) of below &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Better Pie Chart' href='http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php?title=&#038;country=&#038;onclick=y&#038;popularity=&#038;desc=&#038;data=,[%270%20to%201%27,2],[%272%20to%203%27,4],[%274%20to%205%27,7],[%276%20to%207%27,1],[%278%20and%20up%27,0]'>Click to see the Pie Chart as a result of the fixed interface to the Histogram Chart<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; it involved, ostensibly, a <font color=olive>one character<\/font> change in the code?   Huh?!   And it is that &#8220;Huh?!&#8221; reaction we want to talk about mostly today.  How did we arrive at this <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php--------GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php--------GETME\" title=\"histogram_chart.php\" target=\"_blank\">very small change<\/a>?<\/p>\n<p>To start with, we need to explain that the graphics of the Histogram Chart are formed via <a target=_blank title='HTML svg information from w3schools' href='https:\/\/www.w3schools.com\/graphics\/svg_intro.asp'>svg<\/a> (Scalable Vector Graphics), and we need to <a target=_blank title='Data scraping information from Wikipedia' href='https:\/\/en.wikipedia.org\/wiki\/Data_scraping'>&#8220;data scrape&#8221;<\/a> these graphics in order to reform a new Pie Chart URL, especially its &#8220;data&#8221; argument.<\/p>\n<p>And so, the next step to debugging our issue, remembering that characteristic to the code, above, was top search through it for &#8220;svg&#8221; and so <font color=blue>got to<\/font> &#8230;<\/p>\n<p><code><br \/>\n              var huhsvg=null;<br \/>\n              if (pardata == '') {<br \/>\n              lh=document.URL + '?title=\" . urlencode(str_replace(\",\",\"`\",$GETtitle)) . '&task=' . urlencode($GETtask) . '&onclick=y&desc=' . urlencode($GETdesc) . \"&data=' + ourencodeURIComponent(ans);<br \/>\n              } else {<br \/>\n              lh=document.URL.replace(pardata, ourencodeURIComponent(ans));<br \/>\n              }<br \/>\n              if (teledata == '') {<br \/>\n                huhsvg=document.getElementsByTagName('svg');<br \/>\n                if (1 == 1) { \/\/huhsvg.length != 0) {<br \/>\n                  <font color=blue>analyzesvg(document.body.innerHTML);<\/font>  \/\/ mobile fix<br \/>\n                }<br \/>\n              }<br \/>\n<\/code><\/p>\n<p> &#8230; as the &#8220;honing in&#8221; Javascript function where the issue probably resides, helping with the &#8220;where to look&#8221; part to a solution.<\/p>\n<p>Okay, there is something else interesting above with the problematic Pie Chart URL&#8217;s &#8220;data&#8221; argument (array of structures) as per &#8230;<\/p>\n<p><code><br \/>\n&data=%20,[%270%20to%201%27,0]%20,[%272%20to%203%27,0]%20,[%274%20to%205%27,0]%20,[%276%20to%207%27,0]%20,[%278%20and%20up%27,0]<br \/>\n ... via decodeURIComponent becaomes ...<br \/>\n&data= ,['0 to 1',0] ,['2 to 3',0] ,['4 to 5',0] ,['6 to 7',0] ,['8 and up',0]<br \/>\n<\/code><\/p>\n<p>The string parts of the structure look feasible and apt for the resultant Pie Chart, but all those &#8220;0&#8221; (zero) counts don&#8217;t look apt, and are no doubt causing the Pie Chart graphics to not be there, as a hint for helping with the &#8220;what to look out for&#8221; part to a solution.<\/p>\n<p>Sometimes a &#8220;what to look out for&#8221; is obvious in a small Javascript function.  Alas not so with getting to that <font color=purple>final change<\/font> in &#8230;<\/p>\n<p><code><br \/>\n   function analyzesvg(svgsisvgsinnerHTML) {<br \/>\n     \/\/ ,['Work',11]<br \/>\n     \/\/ var teledata='&data=,';<br \/>\n     var ismobile=false;<br \/>\n     var ix=0, xspo, spo, lastones, isvgs=0, its=0, jts=0, firsty=-1.0, ts, thisones, prevone='', xs, zs, ns, thist='', telex='', telez='', teleih='', tdsuff='', tdelim='', tsuffix=' ';<br \/>\n     var svgs=document.getElementsByTagName('svg');<br \/>\n<br \/>\n     if (svgsisvgsinnerHTML != '') {<br \/>\n       if (navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) ismobile=false; \/\/true;<br \/>\n     }<br \/>\n<br \/> <br \/>\n     for (isvgs=0; isvgs&lt;svgs.length; isvgs++) {<br \/>\n     if (svgsisvgsinnerHTML == '') {<br \/>\n      svgsisvgsinnerHTML=svgs[isvgs].innerHTML;<br \/>\n     }<br \/>\n       if (svgsisvgsinnerHTML.indexOf('&lt;text ') != -1) {<br \/>\n         teledata='&data=,';<br \/>\n         <font color=brown>ts=svgsisvgsinnerHTML.split('text-anchor=\"middle\"');<\/font><br \/>\n<br \/> <br \/>\n\/\/0 ... &lt;text fill=\"#444444\" stroke-width=\"0\" stroke=\"none\" font-size=\"14\" font-family=\"Arial\" y=\"425.9\" x=\"161.5\"<br \/>\n\/\/1 ... &gt;0&lt;\/text&gt;&lt;\/g&gt;&lt;g&gt;&lt;text fill=\"#444444\" stroke-width=\"0\" stroke=\"none\" font-size=\"14\" font-family=\"Arial\" y=\"425.9\" x=\"277.1\"<br \/>\n\/\/2 ... &gt;10&lt;\/text&gt;&lt;\/g&gt;&lt;g&gt;&lt;text fill=\"#444444\" stroke-width=\"0\" stroke=\"none\" font-size=\"14\" font-family=\"Arial\" y=\"425.9\" x=\"392.70000000000005\"<br \/>\n\/\/3 ...<br \/>\n         lastones=ts[0].split('&lt;');<br \/>\n         for (its=1; its&lt;ts.length; its++) {<br \/>\n           xspo=ts[its].split('&gt;')<br \/>\n           thisones=xspo[1].split('&lt;');<br \/>\n           if (tdelim == '') {<br \/>\n             prevone=thisones[0];<br \/>\n             if (ismobile == true) alert('ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n           } else if (tsuffix == ' ' && Math.abs(Math.abs(eval(prevone) - eval(thisones[0])) - 1) &lt; 0.001 && (\"\" + thisones[0] + \"\" + prevone).indexOf(\".\") == -1) {<br \/>\n             if (ismobile == true) alert('2 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='';<br \/>\n             teledata+=tsuffix + tdsuff;<br \/>\n           } else  if (tsuffix == ' ' && (\"\" + thisones[0] + \"\" + prevone).indexOf(\".\") == -1) {<br \/>\n             if (ismobile == true) alert('3 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='  to ' + eval(thisones[0] - 1);<br \/>\n             teleih+=tsuffix.replace(' ','');<br \/>\n             teledata+=tsuffix.replace(' ','') + tdsuff;<br \/>\n             tsuffix='  and up';<br \/>\n             if (eval(1 + its) &lt; eval(ts.length)) {<br \/>\n               if (ismobile == true) alert(eval(1 + its) + ' &lt; ' + ts.length);<br \/>\n               if (ismobile == true) alert(ts[eval(1 + eval(its))]);<br \/>\n               jts=eval(thisones[0]);<br \/>\n               \/\/thisones=ts[eval(1 + eval(its))].replace('&gt;','').split('&lt;');<br \/>\n               spo=ts[eval(1 + eval(its))].split('&gt;')<br \/>\n               thisones=spo[1].split('&lt;');<br \/>\n               if (eval(thisones[0] - 1) == eval(jts)) {<br \/>\n               tsuffix='';<br \/>\n               } else {<br \/>\n               tsuffix='  to ' + eval(thisones[0] - 1);<br \/>\n               }<br \/>\n               \/\/thisones=ts[its].replace('&gt;','').split('&lt;');<br \/>\n               xspo=ts[its].split('&gt;')<br \/>\n               thisones=xspo[1].split('&lt;');<br \/>\n             }<br \/>\n           } else  if (tsuffix == ' ') {<br \/>\n             if (ismobile == true) alert('4 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='  and up';<br \/>\n             teledata+=tsuffix.replace(' ','') + tdsuff;<br \/>\n           } else if (Math.abs(Math.abs(eval(prevone) - eval(thisones[0])) - 1) &lt; 0.001 && (\"\" + thisones[0] + \"\" + prevone).indexOf(\".\") == -1) {<br \/>\n             if (ismobile == true) alert('5 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='';<br \/>\n           } else if ((\"\" + thisones[0] + \"\" + prevone).indexOf(\".\") == -1) {<br \/>\n             if (ismobile == true) alert('6 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='  and up';<br \/>\n             if (eval(1 + its) &lt; eval(ts.length)) {<br \/>\n               \/\/alert(eval(1 + its) + '&lt; ' + ts.length);<br \/>\n               \/\/alert(ts[eval(1 + eval(its))]);<br \/>\n               jts=eval(thisones[0]);<br \/>\n               \/\/thisones=ts[eval(1 + eval(its))].replace('&gt;','').split('&lt;');<br \/>\n               spo=ts[eval(1 + eval(its))].split('&gt;')<br \/>\n               thisones=spo[1].split('&lt;');<br \/>\n               if (eval(thisones[0] - 1) == eval(jts)) {<br \/>\n               tsuffix='';<br \/>\n               } else {<br \/>\n               tsuffix='  to ' + eval(thisones[0] - 1);<br \/>\n               }<br \/>\n               \/\/thisones=ts[its].replace('&gt;','').split('&lt;');<br \/>\n               xspo=ts[its].split('&gt;')<br \/>\n               thisones=xspo[1].split('&lt;');<br \/>\n             }<br \/>\n           } else {<br \/>\n             if (ismobile == true) alert('7 ts[' + its + ']=' + ts[its] + ' thisones[0]=' + thisones[0]);<br \/>\n             tsuffix='  and up';<br \/>\n           }<br \/>\n             if (ismobile == true) alert('a');<br \/>\n           telez+=tdelim + '0';<br \/>\n             if (ismobile == true) alert('aa');<br \/>\n           teleih+=tdelim + thisones[0] + tsuffix.replace(' ','');<br \/>\n             if (ismobile == true) alert('aaa');<br \/>\n           teledata+=tdelim + \"['\" + thisones[0] + tsuffix.replace(' ','') + tdsuff;<br \/>\n             if (ismobile == true) alert('aaaa');<br \/>\n           thist = '&lt;' + lastones[-1 + lastones.length] + 'text-anchor=\"middle\"&gt;' + thisones[0] + '&lt;\/text&gt;';<br \/>\n           if (thist.indexOf('&lt;text text-anchor=') != -1) {<br \/>\n             \/\/alert(ts[its]);<br \/>\n             xspo=ts[its].split('font-');<br \/>\n             thist = '&lt;' + xspo[0] + ' text-anchor=\"middle\"&gt;' + thisones[0] + '&lt;\/text&gt;';<br \/>\n           }<br \/>\n             if (ismobile == true) alert('aaaaa');<br \/>\n           thisones=thist.split(' x=\"');<br \/>\n             if (ismobile == true) alert(thist);<br \/>\n           lastones=thisones[1].split('\"');<br \/>\n             if (ismobile == true) alert('a7');<br \/>\n           telex+=tdelim + lastones[0];<br \/>\n           if (ismobile == true) alert(teledata);<br \/>\n           lastones=ts[its].split('&lt;g&gt;&lt;');<br \/>\n           tdelim=',';<br \/>\n           tdsuff=\"',0]\";<br \/>\n         }<br \/>\n         if (ismobile == true) alert(1);<br \/>\n         xs=telex.split(',');<br \/>\n         if (ismobile == true) alert(11);<br \/>\n         zs=teleih.split(',');<br \/>\n         if (ismobile == true) alert(111);<br \/>\n         ns=telez.split(',');<br \/>\n         if (ismobile == true) alert(1111);<br \/>\n         ts=svgsisvgsinnerHTML.split('&lt;rect ');<br \/>\n         if (ismobile == true) alert(ts.length + ' ... ' + teledata + ' +++ ' + ts[1]);<br \/>\n         if (ismobile == true) alert(teledata);<br \/>\n         for (its=3; its&lt;ts.length; its++) {<br \/>\n            if (ismobile == true) alert(ts[its]);<br \/>\n            thisones=(' ' + ts[its]).replace(' x= ',' x=').split(' x=\"');<br \/>\n            if ((' ' + ts[its]).replace(' x= ','x=').indexOf(' x=\"') != -1) {<br \/>\n            lastones=thisones[1].split('\"');<br \/>\n            } else if ((' ' + ts[its]).replace(' x= ','x=').indexOf(' x=') != -1) {<br \/>\n            thisones=ts[its].replace(' x= ',' x=').split(' x=');<br \/>\n            lastones=thisones[1].substring(1).split(thisones[1].substring(0,1));<br \/>\n            } else {<br \/>\n            thisones=(' ' + ts[its]).replace(' x= ',' x=').split(' x=\"');<br \/>\n            lastones='-999\"'.split('\"');<br \/>\n            }<br \/>\n         \/\/if (eval(its) &lt; 5 && navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) alert(lastones[0] + ' vs ' + ts[its]);<br \/>\n           if (ts[its].indexOf('height=\"1\"') == -1 && ts[its].indexOf('height=\"') != -1 && ts[its].indexOf('fill-opacity=') == -1) {<br \/>\n            for (jts=0; jts&lt;xs.length; jts++) {<br \/>\n              \/\/if (zs[jts].indexOf('3') != -1 && navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) alert(eval(lastones[0]) + ' - ' +  eval(xs[jts]));<br \/>\n              \/\/if (jts == 0 && navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) alert(telex + ' ... ' + eval(lastones[0]) + ' - ' +  eval(xs[jts]));<br \/>\n              if (Math.abs(eval(lastones[0]) - eval(xs[jts])) &lt; 1.<font color=olive>8<\/font>) {  \/\/ used to be 1.0 (22\/2\/2021)<br \/>\n                if (ismobile == true) alert(\"(\" + teledata + \").replace('\" + zs[jts] + ',' + ns[jts] + \"','\" + zs[jts] + ',' + eval(1 + ns[jts]) + \"')=\" + teledata.replace(zs[jts] + ',' + ns[jts], zs[jts] + ',' + eval(1 + ns[jts])));<br \/>\n                teledata=teledata.replace(\"'\" + zs[jts] + \"',\" + ns[jts], \"'\" + zs[jts] + \"',\" + eval(1 + eval(ns[jts])));<br \/>\n                if (ismobile == true) alert(teledata);<br \/>\n                ns[jts]=eval(1 + eval(ns[jts]));<br \/>\n              }<br \/>\n            }<br \/>\n           }<br \/>\n         }<br \/>\n       }<br \/>\n     }<br \/>\n     \/\/ \/\/localhost:8888\/PHP\/HistogramChart\/histogram_chart.php?title=Lengths%20of%20dinosaurs,%20in%20meters&onclick=y&task=Dinosaur&desc=Length&data=,%20[~wrgw~,6]%20,%20[~ewgwsr~,6]%20,%20[~shbtdgjnrf~,4]%20,%20[~ewsgerxfhrft~,4]%20,%20[~esgrshtdhjn~,3]<br \/>\n     \/\/alert(teledata);<br \/>\n     \/\/return teledata;<br \/>\n   }<br \/>\n<\/code><\/p>\n<p>All those &#8220;ismobile&#8221; alert popup box calls in the code above were already there, sussing out the logic needed for <a title='Google Chart Histogram Chart Select Event Synergy Tutorial' href='#gchcsest'>Google Chart Histogram Chart Select Event Synergy Tutorial<\/a>, no doubt, which indicates one way in which to approach the debugging of the issue, some ways to this, for us, being &#8230;<\/p>\n<ul>\n<li>alert or console.log (combined with a web browser&#8217;s web inspector) approach<\/li>\n<li>write information to document.title for example<\/li>\n<li>use debugging approaches that the web inspector offers the programmer\n<\/ul>\n<p>We did indeed use a web inspector to get somewhere.  We opened the Histogram in a webpage and opened the web inspector and pointed at the graph, and moved up to highlight the topmost &#8220;svg&#8221; element parent, and chose the option to &#8220;Copy OuterHTML&#8221; into a buffer we saved to a local text file.   It came as a single very long line, but we calmly put line breaks in at every &#8230;<\/p>\n<ul>\n<li>&lt;g<\/li>\n<li>&lt;text<\/li>\n<li>&lt;rect<\/li>\n<\/ul>\n<p> &#8230; go us to &#8230;<\/p>\n<p><code><br \/>\n&lt;svg width=\"900\" height=\"500\" aria-label=\"A chart.\" style=\"overflow: hidden;\"&gt;&lt;defs id=\"_ABSTRACT_RENDERER_ID_0\"&gt;&lt;clipPath id=\"_ABSTRACT_RENDERER_ID_1\"&gt;<br \/>\n&lt;rect x=\"161\" y=\"96\" width=\"579\" height=\"309\"&gt;&lt;\/rect&gt;&lt;\/clipPath&gt;&lt;filter id=\"_ABSTRACT_RENDERER_ID_2\"&gt;&lt;feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"2\"&gt;&lt;\/feGaussianBlur&gt;&lt;feOffset dx=\"1\" dy=\"1\"&gt;&lt;\/feOffset&gt;&lt;feComponentTransfer&gt;&lt;feFuncA type=\"linear\" slope=\"0.1\"&gt;&lt;\/feFuncA&gt;&lt;\/feComponentTransfer&gt;&lt;feMerge&gt;&lt;feMergeNode&gt;&lt;\/feMergeNode&gt;&lt;feMergeNode in=\"SourceGraphic\"&gt;&lt;\/feMergeNode&gt;&lt;\/feMerge&gt;&lt;\/filter&gt;&lt;\/defs&gt;<br \/>\n&lt;rect x=\"0\" y=\"0\" width=\"900\" height=\"500\" stroke=\"none\" stroke-width=\"0\" fill=\"#ffffff\"&gt;&lt;\/rect&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"start\" x=\"161\" y=\"70.9\" font-family=\"Arial\" font-size=\"14\" font-weight=\"bold\" stroke=\"none\" stroke-width=\"0\" fill=\"#000000\"&gt;Roll of the die&lt;\/text&gt;<br \/>\n&lt;rect x=\"161\" y=\"59\" width=\"579\" height=\"14\" stroke=\"none\" stroke-width=\"0\" fill-opacity=\"0\" fill=\"#ffffff\"&gt;&lt;\/rect&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;rect x=\"161\" y=\"96\" width=\"579\" height=\"309\" stroke=\"none\" stroke-width=\"0\" fill-opacity=\"0\" fill=\"#ffffff\"&gt;&lt;\/rect&gt;<br \/>\n&lt;g clip-path=\"url(http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php#_ABSTRACT_RENDERER_ID_1)\"&gt;<br \/>\n&lt;g&gt;&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"404\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"360\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"316\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"272\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"228\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"184\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"140\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"96\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#cccccc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"382\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"338\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"294\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"250\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"206\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"162\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>161<\/font>\" y=\"118\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#ebebeb\"&gt;&lt;\/rect&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;rect x=\"<font color=red size=1>162.5<\/font>\" y=\"361\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>162.5<\/font>\" y=\"317\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>307.5<\/font>\" y=\"361\" width=\"142\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>307.5<\/font>\" y=\"317\" width=\"142\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>307.5<\/font>\" y=\"273\" width=\"142\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;g&gt;&lt;rect x=\"<font color=red size=1>307.5<\/font>\" y=\"229\" width=\"142\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"310\" y=\"231.5\" width=\"137\" height=\"38\" stroke=\"#ffffff\" stroke-width=\"1\" fill-opacity=\"0\" fill=\"#ffffff\"&gt;&lt;\/rect&gt;&lt;\/g&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"361\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"317\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"273\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"229\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"185\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"141\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>451.5<\/font>\" y=\"97\" width=\"143\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;<br \/>\n&lt;rect x=\"<font color=red size=1>596.5<\/font>\" y=\"361\" width=\"142\" height=\"43\" stroke=\"none\" stroke-width=\"0\" fill=\"#3366cc\"&gt;&lt;\/rect&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;rect x=\"161\" y=\"404\" width=\"579\" height=\"1\" stroke=\"none\" stroke-width=\"0\" fill=\"#333333\"&gt;&lt;\/rect&gt;&lt;\/g&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"<font color=red>161.5<\/font>\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;0&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"<font color=red>306<\/font>\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;2&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"<font color=red>450.5<\/font>\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;4&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"<font color=red>595<\/font>\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;6&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"<font color=red>739.5<\/font>\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;8&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"409.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;0&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"365.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;1&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"321.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;2&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"277.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;3&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"233.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;4&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"189.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;5&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"145.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;6&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"end\" x=\"147\" y=\"101.4\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;7&lt;\/text&gt;&lt;\/g&gt;&lt;\/g&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;\/g&gt;<br \/>\n&lt;\/svg&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; and the &#8230;<\/p>\n<p><code><br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"161.5\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;0&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"306\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;2&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"450.5\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;4&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"595\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;6&lt;\/text&gt;&lt;\/g&gt;<br \/>\n&lt;g&gt;&lt;text text-anchor=\"middle\" x=\"739.5\" y=\"425.9\" font-family=\"Arial\" font-size=\"14\" stroke=\"none\" stroke-width=\"0\" fill=\"#444444\"&gt;8&lt;\/text&gt;&lt;\/g&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; tweaked our interest as of relevance to <font color=brown>the codeline<\/font> &#8230;<\/p>\n<p><code><br \/>\n<font color=brown>ts=svgsisvgsinnerHTML.split('text-anchor=\"middle\"');<\/font><br \/>\n<\/code><\/p>\n<p>Yes, the five here match five parts to the Pie Chart &#8220;data&#8221; argument number of array structures.  The string parts take aspects to their content from these svg text element innerHTML properties.  We were happy with these, but the counts, no.  We might expect an &#8220;eval&#8221; or a &#8220;Math.abs&#8221; bit of code be involved in working out those counts, perhaps?  Yes, the codeline &#8230;<\/p>\n<p><code><br \/>\n              if (Math.abs(eval(lastones[0]) - eval(xs[jts])) &lt; 1.<font color=olive>8<\/font>) {  \/\/ used to be 1.0 (22\/2\/2021)<br \/>\n...<br \/>\n              }<br \/>\n<\/code><\/p>\n<p> &#8230; has all that, and compares <font color=red>those &#8220;x&#8221;<\/font> attribute values, which, since those early days when &#8220;1.0&#8221; covered the differences, now needs &#8220;1.<font color=olive>8<\/font>&#8221; to be useful, and start to make for proper and realistic count values to happen.   Yayyyyyyyyy!<\/p>\n<p>In every coding enterprise, every character counts?!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-interface-tutorial\/'>Google Chart Histogram Chart Pie Chart Interface Tutorial<\/a>.<\/p-->\n<hr>\n<p id='gchcsest'>Previous relevant <a target=_blank title='Google Chart Histogram Chart Select Event Synergy Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-select-event-synergy-tutorial\/'>Google Chart Histogram Chart Select Event Synergy Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Histogram Chart Select Event Synergy Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster_synergy.jpg\" title=\"Google Chart Histogram Chart Select Event Synergy Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Histogram Chart Select Event Synergy Tutorial<\/p><\/div>\n<p>With <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> <a target=_blank title='Select event information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/basic_interactivity'>Select event<\/a> scenarios it is good to look for synergies between the charts, and we&#8217;ve found one regarding the <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>Histogram Chart<\/a> and how it could have a useful &#8220;business logic&#8221; relationship, or &#8220;synergy&#8221; with the <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart' title='Pie Chart'>Pie Chart<\/a>.<\/p>\n<p>Along the way to harnessing this &#8220;synergy&#8221;, the (doh!) human view of it involving just counting up Histogram squares, the (poor old) program has to &#8220;reread&#8221; the &#8220;genius&#8221; of Google developers, and effectively recreating their great Histogram value &#8220;range&#8221; decisions, via Javascript DOM examination of <a target=_blank title='SVG  information from w3schools' href='http:\/\/www.w3schools.com\/svg\/'>SVG<\/a> elements (effectively, feeling like, screen scraping), involving the examination of the Google API&#8217;s resultant HTML div element for the <a target=_blank title='Javascript DOM HTML element innerHTML property information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/prop_html_innerhtml.asp'>innerHTML<\/a> property of its major <a target=_blank title='SVG  information from w3schools' href='http:\/\/www.w3schools.com\/svg\/'>SVG<\/a> element, and look for &#8230;<\/p>\n<ul>\n<li>SVG <a target=_blank title='SVG text element information from w3schools' href='http:\/\/www.w3schools.com\/svg\/svg_text.asp'><i>text<\/i><\/a> elements to glean Pie Chart region labels &#8230; and then a pass to look for &#8230;<\/li>\n<li>SVG <a target=_blank title='SVG text element information from w3schools' href='http:\/\/www.w3schools.com\/svg\/svg_rect.asp'><i>rect<\/i><\/a> elements and compare <i>x<\/i> parameters to find region matches for counting purposes, the final counts of which are passed into the URL to bring up the &#8220;synergy&#8221; Pie Chart, of interest<\/li>\n<\/ul>\n<p>Software wise our HTML &#8220;Dynamic Pollster&#8221; code (itself) is unaffected by this new functionality but the amended Google Chart Histogram Chart (Select event) (in PHP) integration involved &#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php----GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php----GETME\" title=\"histogram_chart.php\" target=\"_blank\">changes<\/a> (to improve the select event (mobile touch) functionality for Pie Chart synergy purposes &#8230; look out for <i>function analyzesvg()<\/i> Javascript function) and a Dynamic Poll button scenario to its HTML iframe is simulated by (ready for you to try an option &#8220;P&#8221; to see the &#8220;synergy&#8221; Pie Chart) &#8230; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\" title='click picture'>live run<\/a> link, or the live run button related to today&#8217;s tutorial picture&#8217;s HTML iframe contents is<br \/>\n<form target='_blank' action='http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php' method='POST'>\n<input type='hidden' name='title' value='Roll of the die'><\/input><br \/>\n<input type='hidden' name='onclick' value='y'><\/input><br \/>\n<input type='hidden' name='task' value='Roll'><\/input><br \/>\n<input type='hidden' name='desc' value='Score'><\/input><br \/>\n<input type='hidden' name='r' value='13'><\/input><br \/>\n<input type='hidden' name='c' value='1'><\/input><br \/>\n<input type='hidden' name='data' value=',[~Three~, 3],[~Four~, 4],[~Four~, 4],[~Three~, 3],[~Five~, 5],[~Four~, 4],[~Five~, 5],[~Four~, 4],[~Five~, 5],[~Six~, 6],[~One~, 1],[~One~, 1],[~Two~, 2],[~Three~, 3]'><\/input><br \/>\n<input type='submit' value='Roll of a die'><\/input><\/form>\n<\/li>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html_GETME\" title=\"dynamic_pollster.html\" target=\"_blank\">dynamic_pollster.html<\/a> (and a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\" title='click picture'>live run<\/a> link) &#8230; unchanged from <a target=_blank title='Google Chart Moving Histogram Chart Select Event Poll Tutorial' href='#gcmhcsept'>Google Chart Moving Histogram Chart Select Event Poll Tutorial<\/a> as shown below (from yesterday)<\/li>\n<\/ul>\n<p>Link to Google Chart Tools &#8220;spiritual home&#8221; &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\n'>via Google<\/a>.<br \/>\nLink to Google Chart Histogram Charts information &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>via Google<\/a>.<br \/>\nLink to Google Chart Pie Charts information &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart' title='Pie Chart'>via Google<\/a>.<br \/>\nLink to our previous <a target=_blank title='PHP\/Javascript\/HTML Google Chart Histogram Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-histogram-tutorial\/'>PHP\/Javascript\/HTML Google Chart Histogram Tutorial<\/a>.<\/p>\n<p>This extra &#8216;select&#8217; event functionality of the Google Chart Histogram Chart web application (in the HTML iframe), available via the suffix \u201c&#038;onclick=y\u201d applied to the Google Chart Histogram Chart title, flows on directly to the iPad iOS App we created and talked about, last, with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xcode-swift-ios-application-end-game-primer-tutorial\/' title='Xcode Swift iOS Application End Game Primer Tutorial'>Xcode Swift iOS Application End Game Primer Tutorial<\/a>.<\/p>\n<hr>\n<p id='gcmhcsept'>Previous relevant <a target=_blank title='Google Chart Moving Histogram Chart Select Event Poll Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-moving-histogram-chart-select-event-poll-tutorial\/'>Google Chart Moving Histogram Chart Select Event Poll Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Moving Histogram Chart Select Event Poll Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.jpg\" title=\"Google Chart Moving Histogram Chart Select Event Poll Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Moving Histogram Chart Select Event Poll Tutorial<\/p><\/div>\n<p>Yesterday it was the the turn of <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>Histogram Charts<\/a> to get them working for their <a target=_blank title='Select event information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/basic_interactivity'>Select event<\/a>, which is like a mobile touch event and non-mobile click event on the Google Chart of interest (which we started on with <a title='Google Chart Histogram Chart Select Event Primer Tutorial' href='#gchcsept'>Google Chart Histogram Chart Select Event Primer Tutorial<\/a> as shown below), and today we test out that functionality with a real world idea which we like to think of as involving a &#8220;Moving Histogram&#8221;, and which we call &#8220;Dynamic Pollster&#8221;.  This &#8220;Moving Histogram&#8221;, to us, and maybe to others, involves our web application making use of the Google Chart Histogram Chart, in an HTML iframe element, is like a polling station or experiment reading recorder, that asks the user to enter raw &#8220;finding&#8221; data, and dynamically piece together a &#8220;Moving Histogram&#8221; for that data, updated after every raw &#8220;finding&#8221; data set is entered.  So the resultant iframe&#8217;s Histogram &#8220;moves&#8221; and is dynamic, similar to how the algorithm for &#8220;Moving Average&#8221; &#8220;moves&#8221; and is dynamic.  By the way, we use a &#8220;Moving Average&#8221; algorithm when piecing together the &#8220;Select&#8221; event derivable &#8230;<\/p>\n<ul>\n<li>Average (or mean) value ( via &#8220;Moving Average&#8221; where <br \/><code>MovingAverage = ((PreviousMovingAverage x (-1 + NumberDataPoints)) + ThisValue) \/ (NumberDataPoints)<\/code> )<\/li>\n<li>Median (or middle) value<\/li>\n<li>Mode (or most numerously occurring) value<\/li>\n<\/ul>\n<p> &#8230; and so we come to some of the practicalities of data sets that could get big &#8230; use an HTML form with method=POST to allow for the larger data sets.<\/p>\n<p>Software wise our HTML &#8220;Dynamic Pollster&#8221; code and amended Google Chart Histogram Chart (Select event) (in PHP) integration involved &#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html_GETME\" title=\"dynamic_pollster.html\" target=\"_blank\">dynamic_pollster.html<\/a> (and a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/dynamic_pollster.html\" title='click picture'>live run<\/a> link) &#8230; and the HTML iframe contents are worked by &#8230;<\/li>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php---GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php---GETME\" title=\"histogram_chart.php\" target=\"_blank\">changes<\/a> (to improve the select event (mobile touch) functionality regarding POSTed data and emails and csv file creation) and <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\" title='click picture'>live run<\/a> link, or the live run button related to today&#8217;s tutorial picture&#8217;s HTML iframe contents is<br \/>\n<form target='_blank' action='http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php' method='POST'>\n<input type='hidden' name='title' value='Roll of the die'><\/input><br \/>\n<input type='hidden' name='onclick' value='y'><\/input><br \/>\n<input type='hidden' name='task' value='Roll'><\/input><br \/>\n<input type='hidden' name='desc' value='Score'><\/input><br \/>\n<input type='hidden' name='r' value='13'><\/input><br \/>\n<input type='hidden' name='c' value='1'><\/input><br \/>\n<input type='hidden' name='data' value=',[~Three~, 3],[~Four~, 4],[~Four~, 4],[~Three~, 3],[~Five~, 5],[~Four~, 4],[~Five~, 5],[~Four~, 4],[~Five~, 5],[~Six~, 6],[~One~, 1],[~One~, 1],[~Two~, 2],[~Three~, 3]'><\/input><br \/>\n<input type='submit' value='Roll of a die'><\/input><\/form>\n<\/li>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/csv.php-------GETME\" title=\"csv.php\" target=\"_blank\">csv.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/csv.php-------GETME\" title=\"csv.php\" target=\"_blank\">changes<\/a> (regarding csv file creation changes)<\/li>\n<\/ul>\n<p>Link to Google Chart Tools &#8220;spiritual home&#8221; &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\n'>via Google<\/a>.<br \/>\nLink to Google Chart Histogram Charts information &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>via Google<\/a>.<br \/>\nLink to our previous <a target=_blank title='PHP\/Javascript\/HTML Google Chart Histogram Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-histogram-tutorial\/'>PHP\/Javascript\/HTML Google Chart Histogram Tutorial<\/a>.<\/p>\n<p>This extra &#8216;select&#8217; event functionality of the Google Chart Histogram Chart web application (in the HTML iframe), available via the suffix \u201c&#038;onclick=y\u201d applied to the Google Chart Histogram Chart title, flows on directly to the iPad iOS App we created and talked about, last, with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xcode-swift-ios-application-end-game-primer-tutorial\/' title='Xcode Swift iOS Application End Game Primer Tutorial'>Xcode Swift iOS Application End Game Primer Tutorial<\/a>.<\/p>\n<hr>\n<p id='gchcsept'>Previous relevant <a target=_blank title='Google Chart Histogram Chart Select Event Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-select-event-primer-tutorial\/'>Google Chart Histogram Chart Select Event Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Histogram Chart Select Event Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart_select_event.jpg\" title=\"Google Chart Histogram Chart Select Event Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Histogram Chart Select Event Primer Tutorial<\/p><\/div>\n<p>Today it&#8217;s the turn of <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>Histogram Charts<\/a> to get them working for their <a target=_blank title='Select event information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/basic_interactivity'>Select event<\/a>, which is like a mobile touch event and non-mobile click event on the Google Chart of interest.<\/p>\n<p>We believe in packing this Select event with business logic, and we think, for a Histogram Chart scenario it would be good to calculate the &#8230;<\/p>\n<ul>\n<li>Average (or mean) value<\/li>\n<li>Median (or middle) value<\/li>\n<li>Mode (or most numerously occurring) value<\/li>\n<\/ul>\n<p> &#8230; for the Histogram data set.  We do Dinosaur lengths today with the tutorial picture, but am sure you could well imagine a Real Estate Histogram of auction house or unit sale prices in a certain area (where the industry here in Australia is often interested in Median values).<\/p>\n<p>Software wise our new Google Chart Histogram Chart (Select event) integration involved &#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php--GETME\" title=\"histogram_chart.php\" target=\"_blank\">histogram_chart.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php--GETME\" title=\"histogram_chart.php\" target=\"_blank\">changes<\/a> (to cater for select event (mobile touch) functionality) and <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\" title='click picture'>live run<\/a> link<\/li>\n<\/ul>\n<p>Link to Google Chart Tools &#8220;spiritual home&#8221; &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\n'>via Google<\/a>.<br \/>\nLink to Google Chart Histogram Charts information &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/histogram' title='Histogram Chart'>via Google<\/a>.<br \/>\nLink to our previous <a target=_blank title='PHP\/Javascript\/HTML Google Chart Histogram Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-histogram-tutorial\/'>PHP\/Javascript\/HTML Google Chart Histogram Tutorial<\/a>.<\/p>\n<p>This extra &#8216;select&#8217; event functionality, available via the suffix \u201c&#038;onclick=y\u201d applied to the Google Chart Histogram Chart title, flows on directly to the iPad iOS App we created and talked about, last, with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xcode-swift-ios-application-end-game-primer-tutorial\/' title='Xcode Swift iOS Application End Game Primer Tutorial'>Xcode Swift iOS Application End Game Primer Tutorial<\/a>.<\/p>\n<p>So please try creating your own emailable Google Chart live run for &#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php\" title=\"histogram_chart.php\" target=\"_blank\">Histogram Chart<\/a><\/li>\n<li>\n<form target='_blank' action='http:\/\/www.rjmprogramming.com.au\/PHP\/HistogramChart\/histogram_chart.php' method='POST'>\n<input type='hidden' name='title' value='Lengths of dinosaurs, in meters'><\/input><br \/>\n<input type='hidden' name='onclick' value='y'><\/input><br \/>\n<input type='hidden' name='task' value='Dinosaur'><\/input><br \/>\n<input type='hidden' name='desc' value='Length'><\/input><br \/>\n<input type='hidden' name='data' value=',[~Acrocanthosaurus (top-spined lizard)~, 12.2],[~Albertosaurus (Alberta lizard)~, 9.1],[~Allosaurus (other lizard)~, 12.2],[~Apatosaurus (deceptive lizard)~, 22.9],[~Archaeopteryx (ancient wing)~, 0.9],[~Argentinosaurus (Argentina lizard)~, 36.6],[~Baryonyx (heavy claws)~, 9.1],[~Brachiosaurus (arm lizard)~, 30.5],[~Ceratosaurus (horned lizard)~, 6.1],[~Coelophysis (hollow form)~, 2.7],[~Compsognathus (elegant jaw)~, 0.9],[~Deinonychus (terrible claw)~, 2.7],[~Diplodocus (double beam)~, 27.1],[~Dromicelomimus (emu mimic)~, 3.4],[~Gallimimus (fowl mimic)~, 5.5],[~Mamenchisaurus (Mamenchi lizard)~, 21.0],[~Megalosaurus (big lizard)~, 7.9],[~Microvenator (small hunter)~, 1.2],[~Ornithomimus (bird mimic)~, 4.6],[~Oviraptor (egg robber)~, 1.5],[~Plateosaurus (flat lizard)~, 7.9],[~Sauronithoides (narrow-clawed lizard)~, 2.0],[~Seismosaurus (tremor lizard)~, 45.7],[~Spinosaurus (spiny lizard)~,12.2],[~Supersaurus (super lizard)~,30.5],[~Tyrannosaurus (tyrant lizard)~,15.2],[~Ultrasaurus (ultra lizard)~,30.5],[~Velociraptor (swift robber)~,1.8]'><\/input><br \/>\n<input type='submit' value='Dinosaur example of tutorial picture'><\/input><\/form>\n<\/li>\n<\/ul>\n<p>A curiosity that came up while calculating the Median value of an even number of numbers got explained <a target=_blank title='Explanation' href='https:\/\/www.google.com.au\/search?q=how+do+you+determine+median+of+an+even+number+of+numbers&#038;ie=utf-8&#038;oe=utf-8&#038;gws_rd=cr&#038;ei=zumhVtqcNOe3mAXkjomQDA\\'>here<\/a> &#8230; thanks.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19665' onclick='var dv=document.getElementById(\"d19665\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/google-chart\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19665' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19695' onclick='var dv=document.getElementById(\"d19695\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/iframe\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19695' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19710' onclick='var dv=document.getElementById(\"d19710\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/pie-chart\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19710' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d51767' onclick='var dv=document.getElementById(\"d51767\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/histogram-chart\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51767' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d51775' onclick='var dv=document.getElementById(\"d51775\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/tooltip\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51775' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d51779' onclick='var dv=document.getElementById(\"d51779\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/iframe\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51779' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s Google Chart Histogram Chart Pie Chart Tooltips Tutorial got us going with tooltips, but with a limited &#8220;just text&#8221; feel to them, but if you have done some Google Charts tooltip research you&#8217;ll know the &#8230; tooltip: { trigger: &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-histogram-chart-pie-chart-html-tooltips-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2516,2983,3570,305,307,399,518,565,1786,576,587,1577,3569,1861,932,944,997,1226,3201,1609,1319,1345,1404,2099,1410],"class_list":["post-51779","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-alert","tag-console-log","tag-data-scraping","tag-debug","tag-debugging","tag-eval","tag-google-chart","tag-histogram","tag-histogram-chart","tag-html","tag-iframe","tag-interface","tag-math-abs","tag-outerhtml","tag-php","tag-pie-chart","tag-programming","tag-svg","tag-tooltip","tag-tooltips","tag-tutorial","tag-url","tag-web-browser","tag-web-inspector","tag-web-scraping"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51779"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=51779"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51779\/revisions"}],"predecessor-version":[{"id":51783,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51779\/revisions\/51783"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=51779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=51779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=51779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}