googleVis で生成されたグラフを水平方向と垂直方向の中央に配置したいと思います。
今、私はこのコードを持っています:
---
title: "Untitled"
output: slidy_presentation
---
## Slide with googleVis
```{r, echo=F}
suppressPackageStartupMessages(library(googleVis))
op <- options(gvis.plot.tag="chart")
```
```{r results='asis', tidy=TRUE, echo=F}
Geo=gvisGeoChart(Exports, locationvar="Country",
colorvar="Profit",
options=list(projection="kavrayskiy-vii",
width = 1024,
keepAspectRatio=T))
cat("<center>")
print(Geo, "chart")
cat("</center>")
```
そしてこれは私のcssにあります
img.center {
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%)
}
画像は水平方向に中央揃えされていますが、垂直方向には中央揃えされていません。
私は何を間違っていますか?
ありがとう!