Contenu connexe
Similaire à rChartsによるインタラクティブな可視化表現 (15)
Plus de Yasuyuki Sugai (19)
rChartsによるインタラクティブな可視化表現
- 14. HighChartsとNVD3比較
•出力されたソースを見比べると・・・
"yAxis": [
{
"title": {
"text": "Petal.Length"
}
}
],
"series": [
{
"data": [
[ 0.1, 1.1 ],
:(省略)
[ 0.6, 1.6 ]
],
"name": "setosa",
"type": "scatter",
"marker": {
"radius": 3
}
},
data = [
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.5,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 3,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.7,
"Sepal.Width": 3.2,
"Petal.Length": 1.3,
"Petal.Width": 0.2,
"Species": "setosa"
},Highcharts NVD3
- 20. NVD3 時系列データ編
•1年のデータを折れ線でプロット
•NVD3の機能を利用して日付範
囲を任意に変更可能に
•
p <- nPlot(value ~ date, data = electric2, type = 'lineWithFocusChart')
p$xAxis( tickFormat="#!function(d) {
return d3.time.format('%m/%d')(new Date( d * 86400000 ));
}!#" )
p$x2Axis( tickFormat="#!function(d) {
return d3.time.format('%b')(new Date( d * 86400000 ));
}!#" )
p$chart(tooltipContent = "#! function(key, x, y, e, graph){
return 'date: ' + d3.time.format('%Y/%m/%d')(new Date( e.point.date * 86400000 ));
} !#")
p$set(width=1000, height=500)
p