Google 嵌入 API 图表类型?
Google Embed API Chart Types?
我正在尝试使用嵌入 API 从我的 Google Analytics 帐户制作自定义仪表板。
下面,您将看到用于在屏幕上呈现图表的代码。在 chart
对象内部,有一个名为 type
的 属性,在下面的示例中被设置为 LINE
。
在哪里可以找到这些值的列表?不得不任意猜测字符串值是什么真的很烦人。该文档没有显示可能的值是什么或有多少。
我尝试转到 Goolge 图表页面并查找列表,但我也找不到。感谢任何帮助。
var dataChart = new gapi.analytics.googleCharts.DataChart({
query: {
metrics: 'ga:sessions,ga:uniquePageviews',
dimensions: 'ga:date',
'start-date': '10daysAgo',
'end-date': 'yesterday'
},
chart: {
container: 'chart-container',
type: 'LINE',
options: {
width: '100%'
}
}
});
您可以检查Built-in Components Reference of Embed API and checkout the Datachart Options。
以下是图表类型:
- 行
- 列
- 酒吧
- TABLE
- 地理位置
还有一种图表类型 PIE
。官方文档中没有提到这一点。 Here is a demo of the PIE
type.
我正在尝试使用嵌入 API 从我的 Google Analytics 帐户制作自定义仪表板。
下面,您将看到用于在屏幕上呈现图表的代码。在 chart
对象内部,有一个名为 type
的 属性,在下面的示例中被设置为 LINE
。
在哪里可以找到这些值的列表?不得不任意猜测字符串值是什么真的很烦人。该文档没有显示可能的值是什么或有多少。
我尝试转到 Goolge 图表页面并查找列表,但我也找不到。感谢任何帮助。
var dataChart = new gapi.analytics.googleCharts.DataChart({
query: {
metrics: 'ga:sessions,ga:uniquePageviews',
dimensions: 'ga:date',
'start-date': '10daysAgo',
'end-date': 'yesterday'
},
chart: {
container: 'chart-container',
type: 'LINE',
options: {
width: '100%'
}
}
});
您可以检查Built-in Components Reference of Embed API and checkout the Datachart Options。
以下是图表类型:
- 行
- 列
- 酒吧
- TABLE
- 地理位置
还有一种图表类型 PIE
。官方文档中没有提到这一点。 Here is a demo of the PIE
type.