plotly / plotly/plotly.R

Unable to see x axis labels completely

オープン
#2,375 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

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

Capture

` 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
    )
  )

})`

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された renderPlotly の例を使って報告内容を再現し、ggplotly(plot1) と layout の xaxis 設定に焦点を当てます。scale_x_date(date_breaks = "1 month") と dynamicTicks が、描画された x 軸ラベルにどのような影響を与えるかを確認します。通常のズームで意図した月ラベルが表示され、インタラクティブなチャートを引き続き利用できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。