(Google Embed API)如何更改图表表格样式的宽度 [英] (Google Embed API) How to change chart-table-style width

查看:385
本文介绍了(Google Embed API)如何更改图表表格样式的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于google-embed-api 不是Google图表,Stack Overflow不允许我创建一个没有1500个声誉的新标签)



您好,



我对CSS并不难以置信,我正在开发一个项目,我必须使用googles新图表嵌入API 。图表是通过js调用gapi.analytics.googleCharts.DataChart()创建的,它创建了我想要的,但是JS调用中的CSS设置覆盖了我指定的那个。


  1. 调用gapi.analytics.googleCharts.DataChart()


  2. 创建google图表表,在下面的div中,width设置为450px


  3. js中创建的in-div css样式覆盖了我的CSS文件的宽度:100% p>


任何帮助都是巨大的,谢谢!
-Alex

解决方案

我发现了任何其他人正在查找的JIC的回答



不是试图覆盖CSS中的样式,我发现google图表在options元素中提供了宽度参数。要设置图表宽度,只需在选项中添加选项并定义宽度: {width:'100%'}



  chart:{type:'TABLE',container:'sessions_table',options:{width:'100%'}}  


(This is regarding google-embed-api NOT google charts, Stack Overflow won't let me create a new tag without 1500 reputation)

Hello,

I'm not incredible at CSS, and am working on a project where I must present a bunch of columns per dimension using googles new charts embed API. The chart is created through a js call to gapi.analytics.googleCharts.DataChart() which creates what I want, perfectly, however the CSS settings in the JS call are overriding the one's I specify.

  1. Calling gapi.analytics.googleCharts.DataChart()

  2. Creates a google charts table, in the div below, with width set to 450px

  3. The js created in-div css style overrides my CSS file's width : 100%

Any help would be huge, and thanks! -Alex

解决方案

I found the answer JIC anyone else is looking

Rather than try to override the styling in CSS, I found that google charts offers a width argument in the options elements. To set the chart width simply add options and define width in options: {width: '100%'}

    chart: {
          type: 'TABLE',
          container: 'sessions_table',
          options: {width: '100%'}
        }

这篇关于(Google Embed API)如何更改图表表格样式的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆