{"id":14573,"date":"2015-05-01T05:01:47","date_gmt":"2015-04-30T19:01:47","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=14573"},"modified":"2015-05-02T21:54:50","modified_gmt":"2015-05-02T11:54:50","slug":"html5-meter-element-progress-bar-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-progress-bar-tutorial\/","title":{"rendered":"HTML5 Meter Element Progress Bar Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML5 Meter Element Progress Bar Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.jpg\" title=\"HTML5 Meter Element Progress Bar Tutorial\"   \/><\/a><p class=\"wp-caption-text\">HTML5 Meter Element Progress Bar Tutorial<\/p><\/div>\n<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from yesterday&#8217;s <a target=_blank title='HTML5 Meter Element Primer Tutorial' href='#hmept'>HTML5 Meter Element Primer Tutorial<\/a> as shown below, we talk about one of the newly introduced, and very useful, elements called <a target=_blank title='HTML5 meter tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'><i>&#8220;&lt;meter&gt;&#8221;<\/i><\/a>.  By the way, the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element does not work with mobile Safari, for instance, and you can read more about this <a target=_blank title='Meter HTML5 element does not work with mobile Safari' href='http:\/\/stackoverflow.com\/questions\/10039676\/html5-meter-in-mobile-safari'>here<\/a>.<\/p>\n<p>As we outlined yesterday, at its core the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element represents a &#8220;fraction of one&#8221; or perhaps you can think this as a &#8220;percentage of one hundred&#8221;, and, as you&#8217;d guess, a generic &#8220;x<sup>th<\/sup> of y for the fraction x\/y&#8221; idea &#8230; where &#8220;y&#8221; could be your &#8220;max&#8221; parameter, and perhaps your &#8220;min&#8221; parameter is zero.  Today we extend that &#8220;fraction&#8221; concept to being a &#8220;fraction&#8221; of completion time, as a progress bar.<\/p>\n<p>Progress bars appear all over the internet.  Personally I love the ones that go backwards, just like those mileposts that increase as you head closer to a town.  In defense of this occasional progress bar behaviour, it can be quite hard to predict when some jobs will finish &#8230; suppose you base it on a file size &#8230; but this may not take into account record sizes or intensity of calculation for particular data record types etcetera etcetera etcetera.<\/p>\n<p>With our progress bar today we analyze the pixels of a user-defined image file and show a few of the most commonly occurring pixel colours appearing in that image (file) and present this as a (Google Chart) bar chart, that changes along with the progress bar &#8220;progressing&#8221;.<\/p>\n<p>So take a look at the PHP code in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php-GETME\" title=\"image_bargraph.php\">image_bargraph.php<\/a>, or a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php\" title=\"live run\">live run<\/a>, for your perusal.  A useful PHP link for this was <a target=_blank title='Useful link' href='http:\/\/php.net\/manual\/en\/function.imagecolorat.php'>this one<\/a> &#8230; so, thanks.  Hope it helps with a project idea you are mulling over now.<\/p>\n<p><b>Stop Press:<\/b> The next tutorial in our sequence called <a target=_blank title='' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-word-count-tutorial\/'>HTML5 Meter Element Word Count Tutorial<\/a> led to some thinking causing changes to our code above which you can see with the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php-GETME\" title=\"image_bargraph.php\">image_bargraph.php<\/a> link.<\/p>\n<hr>\n<p id='hmept'>Previous relevant <a target=_blank title='HTML5 Meter Element Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=14561'>HTML5 Meter Element 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\/HTMLCSS\/meter.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML5 Meter Element Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.jpg\" title=\"HTML5 Meter Element Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">HTML5 Meter Element Primer Tutorial<\/p><\/div>\n<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today we talk about one of the newly introduced, and very useful, elements called <a target=_blank title='HTML5 meter tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'><i>&#8220;&lt;meter&gt;&#8221;<\/i><\/a>.<\/p>\n<p>At its core the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element represents a &#8220;fraction of one&#8221; or perhaps you can think this as a &#8220;percentage of one hundred&#8221;, and, as you&#8217;d guess, a generic &#8220;x<sup>th<\/sup> of y for the fraction x\/y&#8221; idea &#8230; where &#8220;y&#8221; could be your &#8220;max&#8221; parameter, and perhaps your &#8220;min&#8221; parameter is zero.<\/p>\n<p>This element is useful to represent a numerical concept graphically (like a ratio), something we do today with &#8230;<\/p>\n<ul>\n<li>simulation of a stopwatch &#8230; with its seconds, minutes, hours, days, years elapsed<\/li>\n<li>a fraction as (numerator) x \/ y (denominator)<\/li>\n<\/ul>\n<p>Tomorrow we&#8217;ll show you a very commonplace usage for <i>&#8220;&lt;meter&gt;&#8221;<\/i> as a &#8220;progress bar&#8221; which you see so much of on the internet, when you are waiting for something.<\/p>\n<p>So take a look at the HTML code in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.html_GETME\" title=\"meter.html\">meter.html<\/a>, or a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.html\" title=\"live run\">live run<\/a>, for your perusal.  Hope it helps with an HTML project you are on now.<\/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='#14561' onclick='var dv=document.getElementById(\"d14561\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=HTML5\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14561' 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='#14573' onclick='var dv=document.getElementById(\"d14573\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=GUI\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14573' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from yesterday&#8217;s HTML5 Meter Element Primer Tutorial as shown below, we talk about one of the newly introduced, and very &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-progress-bar-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,17,37],"tags":[130,275,513,518,549,576,578,652,1517,1522,932,997,1521,1083,1200,1319],"class_list":["post-14573","post","type-post","status-publish","format-standard","hentry","category-elearning","category-gui","category-tutorials","tag-bar-chart","tag-cross-browser","tag-google","tag-google-chart","tag-gui","tag-html","tag-html5","tag-javascript","tag-meter","tag-mobile-safari","tag-php","tag-programming","tag-progress-bar","tag-safari","tag-stop-press","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14573"}],"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=14573"}],"version-history":[{"count":10,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14573\/revisions"}],"predecessor-version":[{"id":14604,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14573\/revisions\/14604"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=14573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=14573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=14573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}