在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:rwjblue/pivot.js开源软件地址:https://github.com/rwjblue/pivot.js开源编程语言:JavaScript 87.5%开源软件介绍:Welcome to Pivot.jsPivot.js is a simple way for you to get to your data. It allows for the creation of highly customizable unique table views from your browser.
In our case, results (or the pivot-table) will be displayed as an HTML table pivoting from the input data (CSV or JSON). Without further ado let's get to usage. example or view the Docs for more information.View anUsageStep one is to initialize the pivot object. It expects the following attributes:
[ {name: 'header-name', type: 'string', optional_attributes: 'optional field' },
{name: 'header-name', type: 'string', optional_attributes: 'optional field' }] (See more about fields in Section below)
{zip_code: '34471'} Those are the options that you should consider. There are other options that are well covered in the spec. A valid pivot could then be set up from like so. var field_definitions = [{name: 'last_name', type: 'string', filterable: true},
{name: 'first_name', type: 'string', filterable: true},
{name: 'zip_code', type: 'integer', filterable: true},
{name: 'pseudo_zip', type: 'integer', filterable: true },
{name: 'billed_amount', type: 'float', rowLabelable: false},
{name: 'last_billed_date', type: 'date', filterable: true}]
// from csv data:
var csv_string = "last_name,first_name,zip_code,billed_amount,last_billed_date\n" +
"Jackson,Robert,34471,100.00,\"Tue, 24 Jan 2012 00:00:00 +0000\"\n" +
"Jackson,Jonathan,39401,124.63,\"Fri, 17 Feb 2012 00:00:00 +0000\""
pivot.init({csv: csv_string, fields: field_definitions});
// from json data:
var json_string = '[["last_name","first_name","zip_code","billed_amount","last_billed_date"],' +
' ["Jackson", "Robert", 34471, 100.00, "Tue, 24 Jan 2012 00:00:00 +0000"],' +
' ["Smith", "Jon", 34471, 173.20, "Mon, 13 Feb 2012 00:00:00 +0000"]]'
pivot.init({json: json_string, fields: field_definitions}); Wiki
Articles
AuthorsPivot.js is the work of Robert Jackson and Jonathan Jackson. LicenseThis software is licensed under a modified BSD license. See LICENSE for more details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论