Unable to see x axis labels completely
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 30/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- r
研究方向
使用提供的 renderPlotly 範例重現該報告,重點檢查 ggplotly(plot1) 和 layout 的 xaxis 設定。檢查 scale_x_date(date_breaks = "1 month") 和 dynamicTicks 如何影響算繪後的 x 軸標籤。當預期的月份標籤在正常縮放程度下可見,同時互動式圖表仍可使用時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Unable to show all the months , Its skipping one month after the other, the months are present but not visible until you zoom in.
What needs to be done here
` output$TP1 <- renderPlotly({
df_plot <- filtered_data()
# Ensure the 'date' column is of Date type
df_plot$date <- as.Date(df_plot$date)
# Set font size
base_size <- 15
# Custom label function to split month and year onto separate lines
library(scales)
custom_date_label <- function(x) {
format(x, "%b\n%Y")
}
# Plot 1: Month vs Interest Coverage Ratio
plot1 <- ggplot(df_plot, aes(x = date, y = interest_coverage_ratio_ttm, group = 1)) +
geom_line(color = "red", size = 1) +
labs(title = "Month vs Interest Coverage Ratio", x = "Date", y = "Interest Coverage Ratio") +
theme_minimal(base_size = base_size) +
theme(
axis.text.x = element_text(size = 8, angle = 0, hjust = 0.5), # Reduce size of x-axis labels
panel.spacing = unit(2, "lines")
) +
scale_x_date(labels = custom_date_label, date_breaks = "1 month") # Custom label formatting
# Convert ggplot objects to plotly objects for interactive tooltips
ggplotly(plot1, dynamicTicks = TRUE) %>%
layout(
xaxis = list(
tickformat = "%b\n%Y" # Format the tooltips as month and year on separate lines
)
)
})`
- 主要語言
- R
- 星號
- 2.7k
- 分支
- 640
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/plotly.R 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 68/100
-
難度 3/5 1-2 天 新手友好度 72/100
-
save_image Error未關閉
難度 3/5 1-2 天 新手友好度 52/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 90/100
-
難度 2/5 1-3 小時 新手友好度 78/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#330 ·
-
core
難度 1/5 1 小時以內 新手友好度 86/100
insightsengineering/teal#1747 ·
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
JamesHWade/deputy#236 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 3 天內回覆