我见过一个 facebook 应用程序,其中单击一个单选按钮会呈现一个图表.
如下图所示:
我想知道是否有任何类似的图形库可以在 php 中生成相同的图形.
谢谢,
潘卡伊
实际上,生成这种图形很容易——只需使用两个 DIV
s——一个是 100% 宽度的条,另一个DIV 是在第一个 DIV 中制作您需要的背景颜色 %.你甚至可以在其中包含文本.简单,只是简单的 HTML/CSS.
更新:
HTML:
CSS:
.bar { 宽度:99%;边框:1px 实心 #000;}.percentage { 背景:#000;}
I have seen a facebook application in which clicking on a radio button renders a graph.
As you can see below:
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 DIV
s - 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的简单水平条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!