0
光るアプリでPlotlyグラフをレンダリングしようとしています。基本グラフは生成されていますが、軸の書式設定はできません。以下のようなレイアウトで、Plotly Webアプリケーションで目的のグラフオプションを取得することができます。renderPlotly(Shiny r)内で詳細なレイアウトを指定する方法
"layout": {
"autosize": true,
"height": 831.625,
"hovermode": "x",
"width": 1480,
"xaxis": {
"autorange": true,
"hoverformat": "%Y-%m",
"range": [
1356978600000,
1391193000000
],
"rangeselector": {
"buttons": [
{
"label": "reset",
"step": "all"
},
{
"label": "#1",
"step": "month"
}
]
},
"tickformat": "%Y-%m",
"tickmode": "auto",
"tickprefix": "",
"title": "B",
"type": "date"
},
"yaxis": {
"autorange": true,
"range": [
-19.888888888888893,
397.8888888888889
],
"title": "A",
"type": "linear"
}
}
光沢のあるコード内でこのレイアウトを指定する際に問題があります。 titleのような単純なオブジェクトの場合は、以下のように動作します。
output$plot <- renderPlotly({
new_plot <- plot_ly(plot_data, x = plot_data$FY_Month, y = plot_data$Booking_Amount , name = "Test Data (Actual)")
new_plot <- layout(new_plot,title = "Random Title")
new_plot
})
どのように複雑なx軸とy軸のレイアウトを教えてください。