如何将rcharts(nplot)嵌入到shiny with html文件中?

如何将rcharts(nplot)嵌入到shiny with html文件中?,html,shiny,rcharts,Html,Shiny,Rcharts,我想在闪亮的服务器中嵌入一个nplot shinyServer(function(input, output) { output$testChart <- renderChart2({ n1<-nPlot(Freq ~ Var1, data=speedTable, type="discreteBarChart", color="blue") n1$xAxis(axisLabel = "Heading") n1$yAxis(axisLabel = "label", width =

我想在闪亮的服务器中嵌入一个nplot

shinyServer(function(input, output) {

  output$testChart <- renderChart2({
n1<-nPlot(Freq ~ Var1, data=speedTable, type="discreteBarChart", color="blue")
n1$xAxis(axisLabel = "Heading")
n1$yAxis(axisLabel = "label", width = 40)
n1$set(title = "Title")
n1$addParams(dom = 'testChart') 
return(n1)

})
})
shinyServer(功能(输入、输出){
输出$testChartHi您必须下载并将其包含到HTML中:

<script src="d3.min.js"></script>
<link href="nv.d3.min.css" rel="stylesheet">
<script src="nv.d3.min.js"></script>

对于图表,可以这样做:

<div id="testChart" class="shiny-html-output rChart nvd3"></div>
<style>.nvd3-svg { margin: 0px; padding: 0px; height: 100%; width: 100%; }</style> 

.nvd3 svg{边距:0px;填充:0px;高度:100%;宽度:100%;}
您看到这个了吗
<div id="testChart" class="shiny-html-output rChart nvd3"></div>
<style>.nvd3-svg { margin: 0px; padding: 0px; height: 100%; width: 100%; }</style>