简单的水平条形图使用PHP [英] Simple Horizontal Bar Graph using php

查看:136
本文介绍了简单的水平条形图使用PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



正如您在下面看到的那样:



替代文字http://img684.imageshack.us/img684/ 539 / poll1.png



替代文字http://img694.imageshack.us/img694/3415/poll2.png



我想知道是否有任何通过它可以在php中生成相同的图表。



谢谢,



Pankaj

解决方案

实际上,生成这种图很容易 - 只需使用两个 DIV s - 一个是100%的宽度条,另一个DIV是在第一个DIV中,使背景颜色为你需要的%。你甚至可以在其中包含文字。简单的HTML / CSS。



更新:



HTML:

 < div class =bar> 
< div class =percentagestyle =width:66%>这是66%宽div< / div>
< / div>

CSS:

  .bar {width:99%; border:1px solid#000; } 
.percentage {background:#000; }


I have seen a facebook application in which clicking on a radio button renders a graph.

As you can see below:

alt text http://img684.imageshack.us/img684/539/poll1.png

alt text http://img694.imageshack.us/img694/3415/poll2.png

I wanted to know whether there is any similar graph library through which i can generate the same graph in php.

Thanks,

Pankaj

解决方案

actually, generating this kind of graph is pretty easy - just use two DIVs - one is a 100% width bar, another DIV is in that first DIV making background colored % you require. you can even include text in that. easy, just plain HTML/CSS.

UPDATE:

HTML:

<div class="bar">
    <div class="percentage" style="width:66%">This is 66% wide div</div>
</div>

CSS:

.bar { width: 99%; border: 1px solid #000; }
.percentage { background: #000; }

这篇关于简单的水平条形图使用PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆