{"id":15954,"date":"2015-07-13T05:01:27","date_gmt":"2015-07-12T19:01:27","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=15954"},"modified":"2015-07-12T14:32:05","modified_gmt":"2015-07-12T04:32:05","slug":"phpjavascript-google-candlestick-waterfall-chart-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-google-candlestick-waterfall-chart-tutorial\/","title":{"rendered":"PHP\/Javascript Google Candlestick Waterfall Chart Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP\/Javascript Google Candlestick Waterfall Chart Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_waterfall.jpg\" title=\"PHP\/Javascript Google Google Candlestick Waterfall Chart Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript Google Candlestick Waterfall Chart Tutorial<\/p><\/div>\n<p>We&#8217;re returning to Google Graphs API, or Google Chart Tools, and its Candlestick Chart functionality as last talked about, specifically, with previous <a target=_blank title='PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial' href='#pjhgccct'>PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial<\/a> (as shown below), to develop, further, here, some improved functionality.  Specifically we address &#8230;<\/p>\n<ol>\n<li>a way to show a Waterfall look<\/li>\n<li>a way to cater for a POST message from an HTML form (so that more data can be handled)<\/li>\n<li>a way to show a customised tooltip<\/li>\n<\/ol>\n<p>The last two tooltip functionality improvements above, you may remember also being applied to a Pie Chart with <a target=_blank title='PHP and jQuery Google Pie Chart Tooltips Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-and-jquery-google-pie-chart-tooltips-tutorial\/'>PHP and jQuery Google Pie Chart Tooltips Tutorial<\/a> a couple of days back and to the Map Chart some days back when we published <a target=_blank title='PHP\/Javascript\/HTML Google Chart Map Onclick Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-map-onclick-tutorial\/'>PHP\/Javascript\/HTML Google Chart Map Onclick Tutorial<\/a>.  As the weeks go on, others will also be attended to.<\/p>\n<p>It is quite likely that now is a good time for you to consult the Candlestick (or Waterfall) Chart information page &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/candlestickchart' title='Google Candlestick Charts'>via Google<\/a>.<\/p>\n<p>The Candlestick Chart&#8217;s tooltip (content) is heavily weighted towards a standard row number range display, as you might expect, so we looked up whether other ideas can come into play and we stumbled upon this excellent <a target=_blank href='https:\/\/gist.github.com\/alexrainman\/bb8d49357250df0859c0' title='Useful link'>webpage<\/a>, for which we give hearty thanks.<\/p>\n<p>If you&#8217;ve &#8220;digested&#8221; this information, you&#8217;ll see that it calls upon <a target=_blank href='http:\/\/jquery.org' title='jQuery Javascript library home page'>jQuery<\/a> functionality to help out our usual Javascript client code for the Candlestick (or Waterfall) Charts.  It is clever enough to allow an onmouseover (ie. hover event) tooltip to be able to handle HTML functionality, so you&#8217;ll see most of the changes to our PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php--GETME\" title='candlestick_chart.php'>candlestick_chart.php<\/a> code revolving around &#8230;<\/p>\n<ul>\n<li>effectively informing the user when they can intervene to tailor a tooltip (if combined with HTML content it can tailor the actual look of the Candlestick (or Waterfall) Chart as well, because it will show labels rather than percentages), and what they have to do, in general terms (just to set the pattern, for tailoring this, specifically (my favourite word for several days now), to your own requirements)<\/li>\n<li>validating this user entry data for what will suit the PHP program and its interface to the Google Chart API usage &#8230; lots of <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/jsref_encodeURIComponent.asp' title='Javascript encodeURIComponent  method information from w3schools'>encodeURIComponent<\/a> here!<\/li>\n<\/ul>\n<p>Having optionally customised tooltips off the candlestick of the Candlestick (or Waterfall) Chart could be used to enhance its functionality considerably, should you be looking for the Candlestick (or Waterfall) Chart to be an interactive reporting tool, perhaps for collaboration purposes, as you can email your Candlestick (or Waterfall) Chart, as well, as we talked about with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-charts-emailing-primer-tutorial\/' title='Google Charts Emailing Primer Tutorial'>Google Charts Emailing Primer Tutorial<\/a>.<\/p>\n<p>So the PHP code changed from that emailing (<a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-charts-emailing-primer-tutorial\/' title='Google Charts Emailing Primer Tutorial'>Google Charts Emailing Primer Tutorial<\/a>) functionality as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php--GETME\" title-'candlestick_chart.php'>this link<\/a>.<\/p>\n<p>And so we&#8217;ll leave you with a link to a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php\" title='Click picture'>live run<\/a> (as a GET method).<\/p>\n<hr>\n<p id='pjhgccct'>Previous relevant <a target=_blank title='PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-candlestick-chart-tutorial\/'>PHP\/Javascript\/HTML Google Chart Candlestick Chart 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\/CandlestickChart\/candlestick_chart.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/CandlestickChart.jpg\" title=\"PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial<\/p><\/div>\n<p>Here is a tutorial that introduces you to Google Graphs API, or Google Chart Tools, and its Candlestick Chart functionality.<\/p>\n<blockquote><p>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.<\/p><\/blockquote>\n<p>Let&#8217;s see some  <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php'>PHP<\/a> code in live action for this tutorial where you define your candlestick chart characteristics and data.<\/p>\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 Tools Candlestick Chart information &#8230; <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/candlestickchart' title='Google Candlestick Charts'>via Google<\/a>.<\/p>\n<p>Link to some downloadable PHP programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/CandlestickChart\/candlestick_chart.php_GETME' title='Download me'>candlestick_chart.php<\/a>.\n<\/p>\n<\/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='#d3988' onclick='var dv=document.getElementById(\"d3988\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Google+Chart#content\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d3988' 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='#d15954' onclick='var dv=document.getElementById(\"d15954\"); 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='d15954' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re returning to Google Graphs API, or Google Chart Tools, and its Candlestick Chart functionality as last talked about, specifically, with previous PHP\/Javascript\/HTML Google Chart Candlestick Chart Tutorial (as shown below), to develop, further, here, some improved functionality. Specifically we &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-google-candlestick-waterfall-chart-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,17,37],"tags":[1617,1605,513,518,1608,576,652,663,861,871,932,997,1226,1609,1319,1618],"class_list":["post-15954","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-gui","category-tutorials","tag-candlestick-chart","tag-encodeuricomponent","tag-google","tag-google-chart","tag-hover","tag-html","tag-javascript","tag-jquery","tag-onclick","tag-onmouseover","tag-php","tag-programming","tag-svg","tag-tooltips","tag-tutorial","tag-waterfall-chart"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15954"}],"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=15954"}],"version-history":[{"count":9,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15954\/revisions"}],"predecessor-version":[{"id":15963,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15954\/revisions\/15963"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=15954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=15954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=15954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}