【问题标题】:Legend and controls overlapping at rcharts图例和控件在 rcharts 重叠
【发布时间】:2015-03-04 23:17:00
【问题描述】:

我一直在尝试使用 rcharts 在 slidify 中处理图例和控件的重叠。 Chrome 下的行为如下:

https://codemorecode.wordpress.com/2015/03/04/legend-and-controls-overlapping-at-rcharts/

但是,对 YAML 前文中元数据的任何更改都不起作用。任何建议我都会非常感谢。干杯,

胡安-卡洛斯

下面是我的yaml:

`---
title       :
subtitle    : AAD-UTAS PhD Program in Quantitative Antarctic Science (QAS) 
author      : Juan-Carlos Quiroz
job         : March, 2015
framework   : io2012
highlighter : highlight.js
hitheme     : tomorrow
widgets     : [bootstrap, quiz, interactive, shiny]
mode        : selfcontained
knit        : slidify::knit2slides
logo        : aad.png
biglogo     : utas.jpg
license     : by-nc-sa
ext_widgets : {rCharts: [libraries/nvd3, libraries/morris]}
runtime     : shiny
---`

【问题讨论】:

    标签: r-markdown rcharts slidify


    【解决方案1】:

    避免此问题的一种方法是将您的 multiBarChart 保存到 html 文件中(您有 2 个选项 cdnstandalone)。生成的 html 文件没有控件重叠的任何问题。例如:

    r1 = nPlot(Catch ~ Years, group = "Class", data = database, type = "multiBarChart")
    r1$xAxis(axisLabel = 'Years')
    r1$yAxis(axisLabel = 'Catch (tons)', width = 55)
    r1$yAxis(tickFormat = "#! function(d) {return d3.format(',.2f')(d)} !#")
    #r1$save('mydata.html', cdn = TRUE)
    r1$save('mydata.html', standalone = TRUE)
    

    然后您需要将 html 文件引用到您的 rmd 文件中,例如:

    ---
    
    ## Embedded html
    
    <iframe width="800" height="400" src = 'assets/mydata.html'></iframe>
    

    【讨论】:

      猜你喜欢
      • 2012-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多