小编use*_*712的帖子

试图将谷歌图表与CSS对齐

我试图将谷歌提供的示例图表居中:https://google-developers.appspot.com/chart/interactive/docs/quick_start 我已经使用了基本的css居中我知道(margin-right: auto;margin-left: auto;),但似乎没有任何工作.到目前为止,我一直只处理文本和图像,所以任何帮助都会非常感激.

这是我正在使用的基本代码(包括谷歌图表javascript)

<!DOCTYPE html> <html> <head> <style> 

  div.chart_div {
    margin-left: auto;
    margin-right: auto;
    width: 800px; }

</style>

<!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // …
Run Code Online (Sandbox Code Playgroud)

html javascript css charts

2
推荐指数
1
解决办法
5424
查看次数

标签 统计

charts ×1

css ×1

html ×1

javascript ×1