CSS FOR BAR GRAPHS

3 comments
CSS FOR BAR GRAPHS

Having a working knowledge of XHTML and CSS when developing applications is a big help in knowing what can be done client-side and what should be generated server-side.

Recently we’ve had to tackle some interesting visualizations which we coded in XHTML and CSS. The method we used, while fairly simple, was a big help to the engineer and created a very flexible and inexpensive solution. We thought we would share our solution and code in case anyone else ran against similar situations.
Update

I posted a live example page with everything in tact. So far I’ve only been able to test in Firefox 1.0.7, Firefox 1.5, IE 6, Safari 1.3.3, and Opera 9(TP1). You can view it here.
Basic CSS Bar Graph

This is a simple bar graph we developed for a tool we’re releasing shortly for our client. The concept is simple, utilize the percentage width abilities of CSS to accurately portray a percentage bar graph.

"Image of bar graph"





Complex CSS Bar Graph

This is a more complex visualization, yet still following the same basic idea. Here the graph is a ‘bad’ to ‘good’ indicator with a marker that travels the length of the color scheme. A lighter bar shade also helps indicate the marker position as it travels from left to right.

"Image of marker graph"





Vertical CSS Bar Graph

In this third example, we utilize the same principle vertically and reproduce it multiple times to create a more complex graph. This particular solution was a relief the to client and engineer as all they had to do was calculate percentages, and the look of the graph was much better than their stock graphing component.

"Image of vertical bar graph"





We hope you enjoyed our examples and find new uses and variations for the concept. Drop us a line if you have any other interesting visualizations using XHTML and CSS and we’ll post them here....

3 comments :

Post a Comment

min-height hack for IE

1 comment
min-height hack for IE

By Jai--> Tags: ,

If you do table-less designs with CSS, you may have noticed that using float on a DIV won’t push it’s container DIV down, so that the container is at least the same height as the floater. For example, on this Blog, the right navigation is formed using float:right but I was having problems when the text in this box was shorter than the content of my nav bar.In IE you can use height on the container, but in Firefox, once the content of that container is too long, it runs outside the borders. In Firefox, you can use min-height, but IE doesn’t recognize it. IE actually handles height the same way firefox handles min-height. So I found a “hack” to make it work in both browsers:

#container{min-height:500px}

#container{* min-height:500px} for ie7

* html #container {height:500px} for ie6 Note: in ie6 have no min-height property so we use height property.

I’m sure it works really fantastic....try it out...

1 comment :

Post a Comment

HTML Introduction

No comments
HTML, an initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as links, headings, paragraphs, lists, and so on — and to supplement that text with interactive forms, embedded images, and other objects. HTML is written in the form of tags, surrounded by angle brackets. HTML can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code (such as JavaScript) which can affect the behavior of Web browsers and other HTML processors.

Files and URLs containing HTML often have a .html or .htm filename extension.

No comments :

Post a Comment