charts - 如何在控件的 Google 图表中将 ui.chartType 设置为 null?
问题描述
我正在使用带有图表范围过滤器控件的谷歌图表。该控件带有一个默认图表(可通过更改 ui.chartType 进行修改)。我想删除默认图表。我正在寻找像 ui.chartType = None 这样的东西来设置控制图的选项。它只是给出一个错误。
var control = new google.visualization.ControlWrapper({
'controlType': 'ChartRangeFilter',
'containerId': 'chartRangeFilter_control_div1',
'options': {
'filterColumnIndex': 0,
'ui': {
'chartType': 'LineChart',
'chartOptions': {
'chartArea': {'width': '90%'},
'hAxis': {'baselineColor': 'none'}
},
// Display a single series that shows the closing value of the stock.
// Thus, this view has two columns: the date (axis) and the stock value (line series).
'chartView': {
'columns': [0, 3]
},
// 1 day in milliseconds = 24 * 60 * 60 * 1000 = 86,400,000
'minRangeSize': 86400000
}
},
'state': {'range': {'start': new Date(2012, 1, 9), 'end': new Date(2012, 2, 20)}}
});
感谢帮助。
解决方案
您应该可以使用该setOption
方法
control.setOption('ui.chartType', null);
但是,我认为需要某种类型的图表...
推荐阅读
- c++ - Qt5 哈希函数在 Windows 7 和 Windows10 上返回的哈希值不同
- reactjs - 扩展 React.Component 的组件中 Key 的效果
- javascript - 更改通过函数签名命名的所有变量的值
- ios - 通知声音没有停止iOS
- arrays - 如何生成具有特定数字范围的列表
- mysql - mysql中*。*授予权限的含义是什么?
- facebook - 我想使用 Graph API 来获取任何用户 ID,我需要向 Facebook api 发送什么?
- python - tensorflow2 错误 - 未能在函数调用 tf.summary.trace_export 中创建插件/配置文件/目录
- android - 您已选择加入 Android TV,但您的 APK 或 Android App Bundle 没有 Leanback Intent
- jupyter-notebook - Jupyterlab 试图复制 Jupiter Shift+Tab+Tab 热键