我怎样才能在闪亮的时候向左对齐?
how I can align to the left on shiny?
嗨,感谢阅读我的文章
我正在制作闪亮的条形图,我希望它从左侧显示,中间没有 space,也就是说,我想删除以下 space 和从那里开始的图表:
有办法吗?我的代码如下:
library(shiny)
library(dplyr)
library(echarts4r)
shinyApp(
ui = fixedPage(
column(12, align="center", offset = 0,
echarts4rOutput(
"grafico", width = 1500, height = 350
)
)
),
server = function(input, output){
output$grafico <- renderEcharts4r({
mtcars |>
tibble::rownames_to_column("model") |>
mutate(total = mpg + qsec) |>
arrange(desc(total)) |>
e_charts(model) |>
e_bar(mpg, stack = "grp") |>
e_bar(qsec, stack = "grp")
})
}
)
这是一个丑陋的修复程序,但它有效:
(注意,我把fixedPage改成了fluidPage,还加了一个div封装你的echarts4rOutput)
library(shiny)
library(dplyr)
library(echarts4r)
shinyApp(
ui = fluidPage(
fluidRow(
column(
12,
tags$div(
style = "margin-left: -75px", offset = 0,
echarts4rOutput(
"grafico", width = 1080, height = 350
)
)
)
)
),
server = function(input, output){
output$grafico <- renderEcharts4r({
mtcars |>
tibble::rownames_to_column("model") |>
mutate(total = mpg + qsec) |>
arrange(desc(total)) |>
e_charts(model) |>
e_bar(mpg, stack = "grp") |>
e_bar(qsec, stack = "grp")
})
}
)
嗨,感谢阅读我的文章
我正在制作闪亮的条形图,我希望它从左侧显示,中间没有 space,也就是说,我想删除以下 space 和从那里开始的图表:
有办法吗?我的代码如下:
library(shiny)
library(dplyr)
library(echarts4r)
shinyApp(
ui = fixedPage(
column(12, align="center", offset = 0,
echarts4rOutput(
"grafico", width = 1500, height = 350
)
)
),
server = function(input, output){
output$grafico <- renderEcharts4r({
mtcars |>
tibble::rownames_to_column("model") |>
mutate(total = mpg + qsec) |>
arrange(desc(total)) |>
e_charts(model) |>
e_bar(mpg, stack = "grp") |>
e_bar(qsec, stack = "grp")
})
}
)
这是一个丑陋的修复程序,但它有效: (注意,我把fixedPage改成了fluidPage,还加了一个div封装你的echarts4rOutput)
library(shiny)
library(dplyr)
library(echarts4r)
shinyApp(
ui = fluidPage(
fluidRow(
column(
12,
tags$div(
style = "margin-left: -75px", offset = 0,
echarts4rOutput(
"grafico", width = 1080, height = 350
)
)
)
)
),
server = function(input, output){
output$grafico <- renderEcharts4r({
mtcars |>
tibble::rownames_to_column("model") |>
mutate(total = mpg + qsec) |>
arrange(desc(total)) |>
e_charts(model) |>
e_bar(mpg, stack = "grp") |>
e_bar(qsec, stack = "grp")
})
}
)