如何在X轴上消除0

时间:2020-03-27 10:47:08

标签: r highcharts

我正在绘制一张高图。在X轴上无法摆脱该0。尝试了很多东西。请帮忙。

hc1 <- highchart(type = "chart" ) %>%
  hc_xAxis(categories = FALSE)%>%
  hc_add_series(name = "Confirmed", data = 
CDR_ordered$Confirmed_ordered.Confirmed) %>%
  hc_add_series(name = "Recovered", data = 
CDR_ordered$Recovered_ordered.Recovered, color = "#FFFF00") %>%
  hc_add_series(name = "Deaths", data = CDR_ordered$Deaths_ordered.Deaths, color = "#FF0000") %>%
  hc_xAxis(title = list(text = "Cases", categories = FALSE)) %>%
  hc_yAxis(title = list(text = "Affected"), minorTickInterval = "auto", minorGridLineDashStyle = "LongDashDotDot")

hc1 <- hc1 %>%
  hc_chart(type = "column",
           options3d = list(enabled = TRUE, beta = 10, alpha = 10)) %>%
  hc_add_theme(hc_theme_google()) %>%
  hc_credits(
    enabled = TRUE, text = "Source: JHU CSS",
    href = "https://raw.githubusercontent.com/datasets/covid-19/master/time-series-19-covid-combined.csv",
    style = list(fontSize = "10px"))

请查看下面的图片以更好地了解

Get Rid of 0 on X-Axis

This is my data

How do I get rid of this 0 now?

1 个答案:

答案 0 :(得分:1)

修改

您有两个updateOne-您可以摆脱第一个。

您可以将update添加到hc_xAxis以在xAxis上隐藏0标签。

要在鼠标悬停时删除标签,可以添加labels = list(enabled = FALSE)

hc_Axis

如果这不起作用,请使用categories = " "(或类似的名称)并在输出中编辑您的问题。可能还有其他选择可以用高图显示结果。

相关问题