d3.time.format中的时间格式
来源:互联网 发布:twitter视频保存软件 编辑:程序博客网 时间:2024/05/29 03:16
%a
- abbreviated weekday name.%A
- full weekday name.%b
- abbreviated month name.%B
- full month name.%c
- date and time, as "%a %b %e %H:%M:%S %Y".%d
- zero-padded day of the month as a decimal number [01,31].%e
- space-padded day of the month as a decimal number [ 1,31]; equivalent to%_d
.%H
- hour (24-hour clock) as a decimal number [00,23].%I
- hour (12-hour clock) as a decimal number [01,12].%j
- day of the year as a decimal number [001,366].%m
- month as a decimal number [01,12].%M
- minute as a decimal number [00,59].%L
- milliseconds as a decimal number [000, 999].%p
- either AM or PM.%S
- second as a decimal number [00,61].%U
- week number of the year (Sunday as the first day of the week) as a decimal number [00,53].%w
- weekday as a decimal number [0(Sunday),6].%W
- week number of the year (Monday as the first day of the week) as a decimal number [00,53].%x
- date, as "%m/%d/%Y".%X
- time, as "%H:%M:%S".%y
- year without century as a decimal number [00,99].%Y
- year with century as a decimal number.%Z
- time zone offset, such as "-0700".%%
- a literal "%" character.
<!DOCTYPE html><metacharset="utf-8"><style>.axistext{ font:10px sans-serif;}.axisline,.axispath { fill: none; stroke:#000; shape-rendering: crispEdges;}</style><body><scriptsrc="http://d3js.org/d3.v3.min.js"></script><script>var customTimeFormat = timeFormat([ [d3.time.format("%Y"),function() {returntrue; }], [d3.time.format("%B"),function(d) {return d.getMonth(); }], [d3.time.format("%b %d"),function(d) {return d.getDate() !=1; }], [d3.time.format("%a %d"),function(d) {return d.getDay() && d.getDate() !=1; }], [d3.time.format("%I %p"),function(d) {return d.getHours(); }], [d3.time.format("%I:%M"),function(d) {return d.getMinutes(); }], [d3.time.format(":%S"),function(d) {return d.getSeconds(); }], [d3.time.format(".%L"),function(d) {return d.getMilliseconds(); }]]);var margin = {top:250, right:40, bottom: 250, left: 40}, width = 960 - margin.left - margin.right, height =500 - margin.top - margin.bottom;var x = d3.time.scale() .domain([new Date(2012,0,1), new Date(2013,0, 1)]) .range([0, width]);var xAxis = d3.svg.axis() .scale(x) .tickFormat(customTimeFormat);var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform","translate(" + margin.left + "," + margin.top +")");svg.append("g") .attr("class","x axis") .attr("transform","translate(0," + height + ")") .call(xAxis);functiontimeFormat(formats) { returnfunction(date) { var i = formats.length -1, f = formats[i]; while (!f[1](date)) f = formats[--i]; return f[0](date); };}</script>
http://bl.ocks.org/mbostock/4149176
http://www.verisi.com/resources/d3-tutorial-basic-charts.htm
- d3.time.format中的时间格式
- d3.time.format中的时间格式
- d3.time.format时间模式
- go time package format 时间格式
- java时间格式format
- format参数时间格式
- C# 时间格式 DateTime Format
- C# 时间格式 DateTime Format
- C# 时间格式 DateTime Format
- string.format 日期时间格式
- 时间格式的显示 format
- Golang 日期时间格式format()
- android.text.format.Time时间类
- COleDateTime::Format 格式 / MFC 时间格式
- 字符串转time格式时间
- Rman中的format格式介绍
- C#中的 Format格式字符串
- Rman的format格式中的%
- POI中关于背景色的使用
- Linux Shell常用技巧(七)
- sp_MSforeachtable使用方法
- android pendingIntent
- Linux Shell常用技巧(八)
- d3.time.format中的时间格式
- android_手机铃声设置
- 【Android 应用开发】BluetoothServerSocket详解
- Linux Shell常用技巧(九)
- SQL Server大表转为分区表实例
- View Transform(视图变换)详解
- NFC----百度百科
- Linux Shell常用技巧(十)
- mysql的group_concat函数使用