- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试在 addColumn
中指定一个模式时,它没有显示。我做错了什么?
data.addColumn({
type: 'date',
label: 'Date',
pattern: "EE dd MMM yyyy"
});
data.addRow([new Date(2016, 02, 05)])
显示值是 Mar 5, 2016
这是默认格式,而我预计 Sat 05 Mar 2016
如 addColumn({pattern: "EE dd MMM yyyy"})
参见 https://jsfiddle.net/qpq3kvhr/3 number
也存在同样的问题。
我在谷歌上搜索了 addColumn(pattern)
的工作示例,但没有找到。
最佳答案
addColumn(type, opt_label, opt_id)
OR
addColumn(description_object)
Second signature has a single object parameter with the following members:
...
pattern
- [Optional, string] A number (or date) format string specifying how to display the column value.
但这是错误的,或者至少是令人困惑的。在 Constructor's JavaScript Literal data parameter 的文档中有不同的解释
cols
Property
cols
is an array of objects describing the ID and type of each column. Each property is an object with the following properties (case-sensitive):
...
pattern
[Optional] String pattern that was used by a data source to format numeric, date, or time column values. This is for reference only; you probably won't need to read the pattern, and it isn't required to exist. The Google Visualization client does not use this value (it reads the cell's formatted value). If the DataTable has come from a data source in response to a query with a format clause, the pattern you specified in that clause will probably be returned in this value.
结论:您不能在 dataTable 或 addColumn 构造函数中指定自动应用的格式模式。相反,应用 formatter之后的专栏。
var formatter = new google.visualization.DateFormat({pattern: "EE dd MMM yyyy"});
formatter.format(data, 0);
关于javascript - 谷歌可视化 API : how to apply a pattern on addColumn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37673076/
我正在尝试根据客户的满意度来获取投票记录的数量。例如: 20 条记录投票支持 5/10 10 条记录投票支持 2/10 5 条记录投票支持 9/10 这是我的数据集的一部分: 我想要每个 Opp ti
当我尝试运行升级脚本时,它在第二个 addcolumn 上给出 Call to undefined method Varien_Db_Statement_Pdo_Mysql::addColumn()
尝试为 EditableGrid 代码创建一个循环。这是现在的样子。 $grid->addColumn('id', 'ID', 'integer'); $grid->addColumn('site',
我想在表格的第七位添加一列,我正在使用 $this->addColumn('table_name','column_name','type'); 在末尾添加列。有什么办法可以提到添加列的地方吗?或者在
我使用 yajra 数据表,但是当我使用“addColumn”方法时遇到了问题。 我使用该方法的一个工作正常,但另一个没有 这是我的源代码: ->addColumn('action',
我在 Yii 中迁移没有问题。但是有一件事让我很困扰。 我无法添加评论。 public function safeUp() { $this->addColumn('pro
我通过仅使用我想要的特定列名称和使用列过滤器的列范围设置扫描仪来扫描 HBase。 添加单独的行: known_fields.forEach(known_field ->scanner.addColu
API 给出的代码如下: public function up() { $this->addColumn('table_name', 'column_name', 'string', $opt
我坚持在 addColumn 语句中添加 if 语句: $inquiries = Inquiry::with('customer')->get(); return Datatables::of($in
我的问题很简单,是否有可能通过数据表的 yajra 库的 addColumn() 函数将变量发送到 Blade View ,类似于 compact() 示例代码: return datatables(
我的问题很简单,是否有可能通过数据表的 yajra 库的 addColumn() 函数将变量发送到 Blade View ,类似于 compact() 示例代码: return datatables(
当我尝试在 addColumn 中指定一个模式时,它没有显示。我做错了什么? data.addColumn({ type: 'date', label: 'Date', pattern:
我有一个带有 的 Express 应用程序 Sequelize 作为 ORM 和 PostgreSQL 作为数据库。 数据库的设置方式是,我的应用程序中的每个租户都有不同的架构。我的应用程序中存在的迁
构建目标:Lab1调用:MacOS X C++ 链接器g++ -o "Lab1"./src/EclipseR.o ./src/EclipseR_test.o ./src/Row.o ./src/Row
在HBase的put操作中有两种类型addImmutable()和 addColumn() . 这两者有什么区别? 不可变是否可以更新/覆盖? 最佳答案 您可以在此 JIRA 中阅读有关此方法的更多信
有没有办法编写一个 liquibase addColumn 变更集,以便它生成像 ALTER TABLE xxx ADD COLUMN yyy AFTER zzz; 我的意思是,有没有办法在 liqu
此函数设置 Magento 网格以显示具有相应“删除”操作的文件名列表。 问题是删除操作从不传递参数“文件名”。 (参见 http://www.premasolutions.com/content/m
有代表价格的数字列。如何在表格网格中将其右对齐。我累了 $this->crud->addColumn([ 'name' => 'amount', 'ty
有代表价格的数字列。如何在表格网格中将其右对齐。我累了 $this->crud->addColumn([ 'name' => 'amount', 'ty
我有一个多步骤过程,可以将汇总基表的表变量分阶段到匹配的粒度。 过程(简而言之): 删除选定的日期过滤器 使用计算值创建过滤器 然后汇总新过滤的表以使粒度匹配 将结果表连接起来形成一个覆盖率表 为此,
我是一名优秀的程序员,十分优秀!