0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

任意の期間の、dateオブジェクト配列を生成する。

Last updated at Posted at 2018-08-31

「1日ごと」や「1時間ごと」などの、日付や時刻のシーケンスを配列として生成します。

 //1日ごと
d3.scaleTime()
	.domain([new Date(2018, 8, 1), new Date(2018, 9,1 )])
	.ticks(d3.timeDay, 1) //区間指定

//2日ごと
d3.scaleTime()
	.domain([new Date(2018, 8, 1), new Date(2018, 9,1 )])
	.ticks(d3.timeDay, 2) 

//月曜日ごと	
d3.scaleTime()
	.domain([new Date(2018, 8, 1), new Date(2018, 9,1 )])
	.ticks(d3.timeMonday, 1)	

//1時間ごと
d3.scaleTime()
	.domain([new Date(2018, 8, 1), new Date(2018, 8,2 )])
	.ticks(d3.timeHour, 1)

出力結果
D3 ver.4 2018-08-31 17-40-35.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?