- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个雷达图,如下所示。有没有一种方法可以让只有 100 的戒指是红色的,而所有其他戒指都保持灰白色?
library(plotly)
fig <- plot_ly(
type = 'scatterpolar',
r = c(135, 75, 110),
theta = c('A','B','C'),
fill = 'toself'
)
fig %>%
layout(
polar = list(
radialaxis = list(
visible = T,
range = c(0, 150)
)
)
)
最佳答案
据我所知,除了零之外,没有在任何轴线上使用自定义格式的选项,因此这里可能实际上没有您希望的“规范”答案。
话虽如此,向您的绘图添加另一条轨迹可能是最好的解决方法,即使它有点笨拙。因为添加的线轨迹覆盖了默认的分类轴,一些更广泛的角轴定制和一些数学手动计算相对于 360 度坐标系的分类值(这通常对用户来说是模糊的)是需要。
Names <- c('A','B','C')
Values <- c(135, 75, 110)
ThetaValues <- seq(from = 0, to = 360, length.out = length(Values)+1L)[seq_len(length(Values - 1L))]
plot_ly() %>%
add_trace(type = 'scatterpolar',mode = "lines",
r = rep(100,100),
theta = seq(from = 0, to = 360, length.out = 100),
line = list(smoothing = 1,
color = "red",
shape = "spline"),
hoverinfo = "skip",
showlegend = FALSE) %>%
add_trace(type = 'scatterpolar',mode = "markers",
r = Values,
name = "",
theta = ThetaValues,
color = I("blue"),
fill = 'toself') %>%
layout(polar = list(radialaxis = list(visible = T,
range = c(0, 150)),
angularaxis = list(visible = T,
type = "category",
ticktext = Names,
tickvals = ThetaValues)))
关于r - 更改在 plotly 中创建的雷达图中特定环的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68304258/
我想尝试用 Java OpenGL 构建雷达。基本上,在该方法中,您传递玩家的当前位置、玩家面对的角度以及敌人的位置。如果敌人就在正前方,那么红点(象征敌人)应该在圆圈(雷达)的顶部,可以说是0度。如
我只是对声纳设备有一个总体的思考。声纳结果如何用数据类型表示。 目前我想出的解决方案是拥有一个 360 2D array,其值表明物体被击中时的距离,最大范围意味着那里什么也没有。这样做的问题是,对于
我有一个雷达图Js。 我不知道如何在区域内放置径向渐变。放置当前代码时,默认只取1种颜色作为background-color 当前代码: let ctx = document.getElementBy
我用在线生成器实现了 amChart。这是结果: https://live.amcharts.com/ODVhY/ 如您所见,带有值的标签仅在红牛上可见。 如何将其扩展到所有 5 个项目符号? 我的配
我需要一种灵活的方法在 ggplot2 中制作雷达/蜘蛛图。从我在 github 和 ggplot2 组上找到的解决方案,我已经走到了这一步: library(ggplot2) # Define a
我想用radare2调试程序“id3v2 -c halo test.mp3”。 如何将参数“-c halo test.mp3”传递给radare2? 我只用 rarun2 找到了一些东西,但是当我这样
我在哪里可以找到适用于 iOS 的优秀蜘蛛(雷达)图表库? (如下图) 我检查了“Core Plot”和“iOSPlot”开源项目,但这些都不支持蜘蛛图。 BR,元一。 最佳答案 在 Github 上
我是一名优秀的程序员,十分优秀!