【问题标题】:rcharts dimple bubble chart in shinyrcharts 有光泽的酒窝气泡图
【发布时间】:2014-03-22 06:31:07
【问题描述】:

使用下面示例酒窝图表的变体,我怎样才能让它通过 Shiny bootstrap 自动缩放,而无需对图表的高度和宽度进行硬编码?

#get data used by dimple for all of its examples as a first test
data <- read.delim(
  "http://pmsi-alignalytics.github.io/dimple/data/example_data.tsv"
)

#eliminate . to avoid confusion in javascript
colnames(data) <- gsub("[.]","",colnames(data))


#example 27 Bubble Matrix
d1 <- dPlot(
  x = c( "Channel", "PriceTier"),
  y = "Owner",
  z = "Distribution",
  groups = "PriceTier",
  data = data,
  type = "bubble",
  aggregate = "dimple.aggregateMethod.max"
)
d1$xAxis( type = "addCategoryAxis" )
d1$yAxis( type = "addCategoryAxis" )
d1$zAxis( type = "addMeasureAxis", overrideMax = 200 )
d1$legend(
  x = 200,
  y = 10,
  width = 500,
  height = 20,
  horizontalAlign = "right"
)
d1

【问题讨论】:

    标签: r rcharts shiny-server dimple.js


    【解决方案1】:

    您好,您必须将width="100%" 放入dplot(),如下所示:

    d1 <- dPlot(
      x = c( "Channel", "PriceTier"),
      y = "Owner",
      z = "Distribution",
      groups = "PriceTier",
      data = data,
      type = "bubble",
      aggregate = "dimple.aggregateMethod.max",
      width="100%"
    )
    

    【讨论】:

    • 非常感谢您回答这个问题;如果您想走在最前沿,我正在尝试在github.com/timelyportfolio/rCharts/tree/dimple_layer 合并所有新的凹坑功能。这是一个例子bl.ocks.org/timelyportfolio/8869959。我会喜欢想法或想法。
    • 干得好!这很有趣,图表很棒。如果我有什么想法,我会告诉你的。
    • 感谢@Victorp 的指点,我设法更深入地使用了 JQuery 和 Bootstrap。最大的痛点是固定尺寸,但事实证明,带有引导程序的脚手架非常有用。
    • @timelyportfolio 我要感谢您提供的优秀库。真的很喜欢 Dimple 作为我首选的可视化库。我一定会浏览您提供的链接。另外,用多个凹坑图完成我闪亮的仪表板——如果你愿意,可以把它拍下来。
    猜你喜欢
    • 2016-03-30
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-31
    • 1970-01-01
    相关资源
    最近更新 更多