Simple Horizontal Bar Graph using php(使用php的简单水平条形图)
问题描述
我见过一个 facebook 应用程序,其中单击一个单选按钮会呈现一个图表.
如下图所示:
我想知道是否有任何类似的图形库可以在 php 中生成相同的图形.
谢谢,
潘卡伊
实际上,生成这种图形很容易——只需使用两个 DIVs——一个是 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 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的简单水平条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用php的简单水平条形图
基础教程推荐
- 将变量从树枝传递给 js 2022-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- php中的PDF导出 2022-01-01
- php中的foreach复选框POST 2021-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
