gpt4 book ai didi

gchart - 谷歌图表饼图 Material 设计

转载 作者:行者123 更新时间:2023-12-04 13:00:47 31 4
gpt4 key购买 nike

我需要在几种类型的图表中显示数据,我喜欢 Material Design 图表的外观和感觉,而不是默认的 google 图表。
折线图和条形图工作得很好,但是, Material 设计中似乎没有饼图......或者至少......我无法让它工作。

在此页面上,Google 声明对于每个核心图表,都可以使用 Material design:
https://developers.google.com/chart/interactive/docs/gallery/barchart

Creating Material bar charts In 2014, Google announced guidelines intended to support a common look and feel across its properties and apps (such as Android apps) that run on Google platforms. We call this effort Material Design. We'll be providing "Material" versions of all our core charts; you're welcome to use them if you like how they look.

Creating a Material Bar Chart is similar to creating what we'll now call a "Classic" Bar Chart. You load the Google Visualization API (although with the 'bar' package instead of the 'corechart' package), define your datatable, and then create an object (but of class google.charts.Bar instead of google.visualization.BarChart).



在饼图页面上,根本没有提到 Material 设计:
https://developers.google.com/chart/interactive/docs/gallery/piechart

我试图按照上面的解释绘制表格,加载“pie”而不是“corechart”并加载“google.charts.Pie”而不是“google.visualization.PieChart”。这不起作用。

有没有人有一个谷歌饼图在 Material 设计中工作?还是真的不可用?

最佳答案

在函数 drawChart() 中添加选项主题

  var options = {
theme: 'material'
};

关于gchart - 谷歌图表饼图 Material 设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57705297/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com