HighChart:使用HC_YAXIS_MULTIPLES设置Yaxis Max和Min(Create_axis(create_axis)(

发布于 2025-02-11 08:35:41 字数 1104 浏览 0 评论 0原文

我有四个图表,每个图都可以比较案例计数,死亡和四种不同疾病之间的比例。我需要帮助设置Ymax& ymin 专门针对比例序列,使它们的y轴都是相同的&它们可以在视觉上可比性。 我需要将y tick设置为[0、30、60]。下面只是疾病图的一个代码示例,因为它们都与不同的数据帧相同。这是在R Markdown中使用高电量软件包。有没有办法在HC_ADD_Series中添加tickpositions?

highchart() %>%
  hc_yAxis_multiples(create_axis(naxis = 3, lineWidth = 3, title = list(text = NULL))) %>% 
  hc_xAxis(categories = graph_data$Month) %>%
  hc_add_series(data = graph_data$Value, name = "Cases", type = "area", color = '#50b7aa',yAxis = 0,dataLabels = list(enabled = F)) %>%
  hc_add_series(data = graph_data1$Value, name = "Deaths", type = "area", color = '#919191', yAxis = 1,dataLabels = list(enabled = F)) %>% 
  hc_add_series(data = graph_data2$Proportion, name = "Proportion",  type = "area", color = '#926f97', yAxis = 2)

” .net/qdy0t.png“ alt =”所有四个图的图片并排”>

I have four graphs that each compare the case counts, deaths, and the proportions between four different diseases over time. I am needing help setting the ymax & ymin specifically for the proportions series so that their y axes are all the same & they can be visually comparable. I need to set the y ticks at [0, 30, 60]. Below is just one code sample of a disease graph since they're all coded the same just with different data frames. This is in R markdown using the Highcharter package. Is there a way to add tickPositions within hc_add_series?

highchart() %>%
  hc_yAxis_multiples(create_axis(naxis = 3, lineWidth = 3, title = list(text = NULL))) %>% 
  hc_xAxis(categories = graph_data$Month) %>%
  hc_add_series(data = graph_data$Value, name = "Cases", type = "area", color = '#50b7aa',yAxis = 0,dataLabels = list(enabled = F)) %>%
  hc_add_series(data = graph_data1$Value, name = "Deaths", type = "area", color = '#919191', yAxis = 1,dataLabels = list(enabled = F)) %>% 
  hc_add_series(data = graph_data2$Proportion, name = "Proportion",  type = "area", color = '#926f97', yAxis = 2)

pic of graph associated with code pasted above

pic of all four graphs side by side

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文