使用php的简单水平条形图

Simple Horizontal Bar Graph using php(使用php的简单水平条形图)
本文介绍了使用php的简单水平条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我见过一个 facebook 应用程序,其中单击一个单选按钮会呈现一个图表.

如下图所示:

我想知道是否有任何类似的图形库可以在 php 中生成相同的图形.

谢谢,

潘卡伊

解决方案

实际上,生成这种图形很容易——只需使用两个 DIVs——一个是 100% 宽度的条,另一个DIV 是在第一个 DIV 中制作您需要的背景颜色 %.你甚至可以在其中包含文本.简单,只是简单的 HTML/CSS.

更新:

HTML:

<div class="percentage" style="width:66%">这是 66% 宽的 div</div>

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的简单水平条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Uploading Image from android to PHP server(将图像从android上传到PHP服务器)
Sending file together with form data via ajax post(通过ajax post将文件与表单数据一起发送)
Laravel - validate file size when PHP max upload size limit is exceeded(Laravel - 超过 PHP 最大上传大小限制时验证文件大小)
How to upload file through Jquery/AJAX(如何通过 Jquery/AJAX 上传文件)
PHP: move_uploaded_file() failed to open stream: No such file or directory(PHP:move_uploaded_file() 无法打开流:没有那个文件或目录)
Creating a file progress bar in PHP(在 PHP 中创建文件进度条)