Css数据图表
Data visualization is mostly achieved with flash applications or
with help of some programming languages. Are those solutions the only
way to present, let's say simple data chart? How about giving it a try
with nothing but good ol' css?
Take a look at the Demo
| Download Css Chart
Approach
In this example I am not using JavaScript or any backend application. All I rely on is well formed markup and css.
So, the goal is to present data chart. We could say that a chart is a
two dimensional object. So, the best structural and semantical choice
is definition list. Why? Well, for starter, it is a list of items.
Although the list is linear, we could interpret definition titles (dt
elements) as items on x axis and definition descriptions (dd elements)
as values on y axis.
If that doesn't make sense because of my poor explanation skills :) what I'll do here is turn this:
into this
with css alone.
The markup
In my example I have used a period of last 12 days and presented my working energy level in percentages,
100% being the best I've felt about working ever. As you can see, on 6th day it went up a bit because I
received a solid paycheck and that boosted me up :)
Anyway, to structure this kind of data I chose definition list. Definition title contains the day title
<dt>Day 1</dt>
And definition description contains the value
<dd>36</dd>
Inside the definition description element I will add a span and nested em element. Not for structural purposes,
but to give myself enough elements to work with. I will also assign classes that I can use later on.
So definition description looks like this now:
<dd><span class="type2 p80"><em>80</em></span></dd>
Styling it
Definition list contains acts as a chart container, so I'll assign background image to it and set the width and
height to match the dimension of the chart. Also, I'll remove default margins and paddings
dl#csschart
相关文档:
今天看到一篇文章是css打造进度条。然后自己做成动态的进度条,同样,使用到css和jauery,请看:
1 首先,需要引入jquery.js文件。
<script src="Content/jquery.js" type="text/javascript"></script>
2 所用到的样式部分:
<style>
.graph {
& ......
作者:李丽媛
邮箱:lly219@gmail.com
日期:2009-1-12
前言(自说自话)
从初识CSS到现在已经5个年头了。大多是断断续续的,可是近一年来接触颇多,甚有一些些体会。
第一次接触只知道font,color,background,margin,padding等基本知识,乃至连margin、padding都分不清个所以然。
在第一次Web大作业中知道了有&ldq ......
ninjacontent组件在我的网站上显示不正常,想修改它的CSS使其正常,可是怎么也找不到它的CSS的位置,现在终于找到了,特把它记录下来,以备有遇到跟我一样问题的人查看。
CSS位置:网站根目录\media\com_ninjacontent\css\目录下。 ......
实现Gridview表头固定可以通过CSS来实现
将GridView放进一个Panel中,然后设置Panel可以有竖滚动条(参见我的另一篇为Gridview生成滚动条)。设置Gridview的Style为<HeaderStyle CssClass="GridViewHeader" />
.GridViewHeader {
position:relative ;
tabl ......