Solved

HTML5 Graphic Fill Percentage

Posted on 2014-04-23
3
569 Views
Last Modified: 2014-05-15
Hello,

I need to represent tank levels on my website, based off of live data.  I have access to the data, but need recommendations on what the best tool is to create this view.  

I'm using an Apache server, but I was thinking HTML5 might be the best approach.  I'd like to show a picture of a liquid tank (like an empty clipart pic of tank).  Something like this:  http://photo.oempromo.com/Prod_799/Stock-Shape-Collection-Big-Propane-Tank-Key-Tag_45839759.jpg

I'd like to show a fill color that fills based on a percentage.  Would it be best to layer the tank, and make the inside of the tank transparent, and overlay that on top of an HTML canvas box?  Any suggestions would be appreciated.

Thanks
0
Comment
Question by:compsol1993
3 Comments
 
LVL 9

Expert Comment

by:WebDevEM
ID: 40018215
I don't have the time right now to work up a demo (meetings all day!) but my thought would be to use a canvas, draw the tank on there (which basically drops your image file onto the canvas, no need to draw it manually), and draw a rectangle either on top of it or behind it (if you make the center transparent) based on your data.

I'm pretty new to HTML5, but I'm sure somebody more familiar could whip up a demo fairly quickly.  It'd take me a decent amount of time... I'd love to see the solution!

I hope this gets you started,

WebDevEM
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 40019451
Canvas is certainly possible but have a look here: http://schutt.nl/ee/Q_28418447/

For this I have re-used parts of an earlier solution I posted here on EE (that's where the colors come from, I don't suppose you have blue and pink liquids ;-)

The files I used are also attached below.
index.html
tankfill.js
tankfill.css
tanktrans.png
0
 

Author Closing Comment

by:compsol1993
ID: 40068178
Perfect, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Xsl Nested Loop 4 26
SAMI File <SYNC Start = (number of millisecond)> Question 3 63
installing and using WTP plugin eclipse MARS 3 98
jQuery Date picker not working 16 105
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now