格式化Charts_flutter时间序列图中的时间标签,使其包含hh:mm:ss

时间:2018-08-22 10:08:10

标签: charts dart flutter

是否可以在chart_flutter时间序列图的xAxis上设置标签格式以显示 hh:mm:ss This answer解释了如何格式化代码以显示月份和日期,但是我需要显示的信息每分钟收集几次。

charts.AutoDateTimeTickFormatterSpec不允许指定秒数。关于上述问题的操作表提到了Charts_flutter画廊中提到的DateTimeFactory,但我也不确定如何使用它,或者在这种情况下是否有任何用途。

new charts.TimeSeriesChart(
  getSeries(item),
  animate: false,
  primaryMeasureAxis: new charts.NumericAxisSpec(
    tickProviderSpec: new charts.BasicNumericTickProviderSpec(zeroBound: false)
  ),
  domainAxis: new charts.DateTimeAxisSpec(
    tickFormatterSpec: new charts.AutoDateTimeTickFormatterSpec(
      hour: new charts.TimeFormatterSpec(format: 'hh', transitionFormat: 'dd/MM hh:mm'),
    )
  ),
),

或者,我可以使用其他图表来实现此功能吗?我看到charts.BarChart允许在xAxis上使用字符串,但是我特别需要一个折线图-如果无法进行上述格式化,是否可以通过某种方式在折线图上指定字符串而不是日期时间?

1 个答案:

答案 0 :(得分:1)

由于在{"result":"Success","message":"","data":[{"id":"86","parentid":"220","aname":"Acer Aspire","aid":"643","did":"505","pcondition":"n","pdescription":"Acer Aspire 5742-6331 15in Laptop","pdate":"06\/30\/2012","pcost":"481.49","pvendor":"St.Pete College","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Jocelyn Home","adescription":"Acer Aspire Laptop (Jocelyn)","apo":"","asn":"LXR4F0248114807C7B1601","awdate":"","anotes":"Transaction GID: 135761","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"220","level":0,"isLeaf":true},{"id":"18","parentid":"38","aname":"APC Battery Back-Up UPS","aid":"649","did":"505","pcondition":"u","pdescription":"APC Smart UPS 1500","pdate":"06\/30\/2012","pcost":"300.00","pvendor":"Craigslist","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"APC Smart UPS 1500 (SUA1500RM2U)","apo":"","asn":"AS0414112240","awdate":"","anotes":"Transaction GID: 135759","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"213","parentid":"38","aname":"APC Battery Back-Up UPS","aid":"649","did":"505","pcondition":"u","pdescription":"APC Smart UPS 1500","pdate":"06\/30\/2012","pcost":"300.00","pvendor":"Craigslist","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"APC Smart UPS 1500 (SUA1500RM2U)","apo":"","asn":"AS041411210","awdate":"","anotes":"Transaction GID: 135759","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"214","parentid":"38","aname":"APC Battery Back-Up UPS","aid":"649","did":"505","pcondition":"u","pdescription":"APC Smart UPS 1500","pdate":"06\/30\/2012","pcost":"300.00","pvendor":"Craigslist","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"APC Smart UPS 1500 (SUA1500RM2U)","apo":"","asn":"AS0414211674","awdate":"","anotes":"Transaction GID: 135759","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"95","parentid":"219","aname":"Apple iMac 24","aid":"643","did":"505","pcondition":"u","pdescription":"Apple 24in iMac ","pdate":"06\/30\/2012","pcost":"1200.00","pvendor":"Jamilou Rosenkrans (Labor Trade Chance)","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Tech Area","adescription":"Apple 24in iMac ","apo":"","asn":"W87350BDZCV","awdate":"","anotes":"Transaction GID: 135763\n2.8GHz, 2GB RAM, 500GB HDD","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"219","level":0,"isLeaf":true},{"id":"206","parentid":"220","aname":"Apple iPad 2","aid":"643","did":"505","pcondition":"u","pdescription":"Apple iPad 2 16GB, Wi-Fi, 9.7in - Black (MC769LL\/A)","pdate":"05\/18\/2015","pcost":"189.99","pvendor":"eBay: eric9730, eBay: likenewproduct","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Jocelyn Home","adescription":"Apple iPad 2 16GB, Wi-Fi, 9.7in - Black (Jocelyn)","apo":"","asn":"DYVJK5LWDFHW","awdate":"","anotes":"Transaction GID: 653397, iPad, $170.00\nTransaction GID: 653393, Portfolio, $19.99","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"220","level":0,"isLeaf":true},{"id":"6","parentid":"222","aname":"Astro Van","aid":"633","did":"505","pcondition":"u","pdescription":"2004 Chevy Astro","pdate":"08\/14\/2008","pcost":"8342.15","pvendor":"TMJ Enterprises","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"3135 Office","adescription":"2004 Chevy Astro","apo":"","asn":"1234567890","awdate":"","anotes":"Transaction GID: 135743","childCount":"0","a_account":"17500: 2004 Chevy Astro","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"222","level":0,"isLeaf":true},{"id":"19","parentid":"38","aname":"Belkin LCD Console","aid":"649","did":"505","pcondition":"u","pdescription":"Belkin 15in 1U Rackmount KVM Console","pdate":"12\/29\/2011","pcost":"218.03","pvendor":"eBay: techforless","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"Belkin 15in 1U Rackmount KVM Console","apo":"","asn":"471001000121","awdate":"","anotes":"Transaction GID: 672437","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"54","parentid":"216","aname":"Black\/Silver Office Chairs (Qty 4)","aid":"412","did":"505","pcondition":"n","pdescription":"4 Black Leather and Silver Metal Office Chairs","pdate":"02\/06\/2013","pcost":"310.00","pvendor":"Fay Marakas","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lobby and Office","adescription":"4 Black Leather and Silver Metal Office Chairs","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 132468","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"17","parentid":"219","aname":"Cisco 24-Port Switch","aid":"649","did":"505","pcondition":"u","pdescription":"PoE Cisco Catalyst 3550 WS-C3550-24PS-S","pdate":"11\/14\/2011","pcost":"300.00","pvendor":"Vology","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Tech","adescription":"Cisco 3550 24-Port PoE Switch","apo":"","asn":"CAT0723Z190","awdate":"","anotes":"Transaction GID: 91077","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"219","level":0,"isLeaf":true},{"id":"205","parentid":"38","aname":"Cisco 48-Port Switch","aid":"649","did":"505","pcondition":"u","pdescription":"PoE Cisco Catalyst 3750 WS-C3750-48PS-S","pdate":"02\/19\/2015","pcost":"695.00","pvendor":"Vology","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Rack","adescription":"Cisco 3750 48-Port PoE Switch","apo":"BS021915","asn":"FDO1338X1G4","awdate":"","anotes":"Transaction GID: 654330","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"44","parentid":"215","aname":"Danby Refrigerator","aid":"407","did":"505","pcondition":"n","pdescription":"10cu.ft. Upright Refrigerator","pdate":"02\/05\/2013","pcost":"400.44","pvendor":"HHGregg","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"3135 Kitchen","adescription":"10cu.ft. Upright Refrigerator","apo":"","asn":"123456789","awdate":"","anotes":"Transaction GID: 120592","childCount":"0","a_account":"17100: Office Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"215","level":0,"isLeaf":true},{"id":"49","parentid":"222","aname":"Dell Inspiron","aid":"643","did":"505","pcondition":"n","pdescription":"Dell Inpiron 17in Laptop","pdate":"08\/02\/2013","pcost":"630.49","pvendor":"Dell","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Dell Inspiron 17in Laptop (Chance)","apo":"","asn":"65YVPX1","awdate":"","anotes":"Transaction GID: 134554\nPurchase Order #: BS080213","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"222","level":0,"isLeaf":true},{"id":"200","parentid":"218","aname":"Dell Optiplex 3010","aid":"643","did":"505","pcondition":"u","pdescription":"Dell Optiplex 3010","pdate":"03\/01\/2018","pcost":"300.00","pvendor":"Safety Harbor Professional","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance desk","adescription":"Dell Optiplex 3010 (Chance)","apo":"","asn":"BGTYNW1","awdate":"","anotes":"Acquired from SHP unti #8 in exchange for multiple services (see contract with SHP)\nTranaction GID:715683, 715602","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"218","level":0,"isLeaf":true},{"id":"201","parentid":"218","aname":"Dell Optiplex 3040","aid":"643","did":"505","pcondition":"n","pdescription":"Dell Optiplex 3040 SFF","pdate":"08\/30\/2016","pcost":"602.39","pvendor":"Dell","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Deneen desk","adescription":"Dell Optiplex 3040 (Deneen)","apo":"BS083016","asn":"FSW4DD2","awdate":"","anotes":"Transaction GID: 669351","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"218","level":0,"isLeaf":true},{"id":"28","parentid":"38","aname":"Dell PowerEdge R300 Server","aid":"649","did":"505","pcondition":"u","pdescription":"Dell PowerEdge R300 Server","pdate":"03\/03\/2012","pcost":"500.00","pvendor":"Craigslist","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"Dell PowerEdge R300 Server","apo":"","asn":"123456789","awdate":"","anotes":"","childCount":"0","a_account":"17700: Networking Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"30","parentid":"221","aname":"Dewalt Air Compressor","aid":"646","did":"505","pcondition":"n","pdescription":"Dewalt 2-Gallon Air Compressor","pdate":"12\/11\/2012","pcost":"423.68","pvendor":"HomeDepot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Dewalt 2-Gallon Air Compressor","apo":"","asn":"123456789","awdate":"","anotes":"Transaction GID: 95704","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"57","parentid":"216","aname":"Display Case","aid":"412","did":"505","pcondition":"u","pdescription":"Point-of-Sale Display Case and Shelving","pdate":"03\/06\/2013","pcost":"867.54","pvendor":"Craigslist\/U-Haul\/Owner","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"3135 Lobby","adescription":"Point-of-Sale Display Case and Shelving","apo":"","asn":"n\/a","awdate":"","anotes":"Owner Contribution: $350.00\nTransaction GID: 97143 $400.00 ATM\nTransaction GID: 97139 $117.54 U-Haul","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"202","parentid":"216","aname":"Eclipse NVR System","aid":"407","did":"505","pcondition":"n","pdescription":"Signature 8CH H.265, H.264 NVR","pdate":"06\/15\/2018","pcost":"437.60","pvendor":"Eclipse","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"3135 office","adescription":"Signature 8CH H.265, H.264 NVR, with qty 4 2MP 3.6MM Bullet Cameras","apo":"BS061318","asn":"T3D93185000428","awdate":"","anotes":"Cameras:\nS\/N: T3WHA181000009\nS\/N: T3WHA181000287\nS\/N: T3WHA181000289\nS\/N: T3WHA181000480","childCount":"0","a_account":"17100: Office Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"199","parentid":"222","aname":"Garmin GPS","aid":"461","did":"505","pcondition":"n","pdescription":"Garmin nuvi 2555LMT","pdate":"02\/24\/2013","pcost":"211.86","pvendor":"Walmart","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"2004 Chevy Astro","adescription":"Garmin nuvi 2555LMT","apo":"","asn":"2LQ229023","awdate":"","anotes":"Transaction GID:96521","childCount":"0","a_account":"17300: Mobile Repair Units","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"222","level":0,"isLeaf":true},{"id":"203","parentid":"216","aname":"Kobalt 3-Gallon Air Compressor","aid":"646","did":"505","pcondition":"n","pdescription":"Kobalt 3-Gallon Air Compressor","pdate":"11\/10\/2013","pcost":"167.06","pvendor":"Lowes","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lobby","adescription":"Kobalt 3-Gallon Air Compressor","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 136657, 25ft Air Hose\/Couplings, $29.03\nTransaction GID: 137512, Compressor, $98.03 + $40.00 = $138.03","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"85","parentid":"218","aname":"Lateral File Cabinet (4-Drawer)","aid":"412","did":"505","pcondition":"u","pdescription":"HON 4-Drawer Lateral File Cabinet","pdate":"06\/30\/2011","pcost":"300.00","pvendor":"Exec Inc Real Estate (Labor Trade Chance)","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Office","adescription":"HON 4-Drawer Lateral File Cabinet","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 135753","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"218","level":0,"isLeaf":true},{"id":"204","parentid":"218","aname":"MFC 9460CDN AIO","aid":"643","did":"505","pcondition":"n","pdescription":"Brother MFC-9460CDN Printer\/Scanner\/Fax","pdate":"03\/05\/2014","pcost":"513.59","pvendor":"Office Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Office","adescription":"Brother MFC-9460CDN Printer\/Scanner\/Fax","apo":"","asn":"U62511-B2J284710","awdate":"","anotes":"Transaction GID: 148148","childCount":"0","a_account":"17600: Computers, Printers, Accessories","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"218","level":0,"isLeaf":true},{"id":"64","parentid":"216","aname":"Plexiglass Logo","aid":"412","did":"505","pcondition":"n","pdescription":"Company Logo and Lettering on custom plexiglass","pdate":"08\/31\/2013","pcost":"382.75","pvendor":"ASAP Signs & Graphics","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lobby","adescription":"Plexiglass Logo","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 678791","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"7","parentid":"217","aname":"Quadro 2x IP-PBX","aid":"650","did":"505","pcondition":"u","pdescription":"Epygi Quadro 2x","pdate":"02\/28\/2010","pcost":"117.45","pvendor":"eBay: darin_ext@darinsmith.net","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lockup","adescription":"Epygi Quadro 2x","apo":"","asn":"132342810461","awdate":"","anotes":"Transaction GID: 670503","childCount":"0","a_account":"17800: Telephony Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"217","level":0,"isLeaf":true},{"id":"43","parentid":"217","aname":"Quadro 4x IP-PBX","aid":"650","did":"505","pcondition":"u","pdescription":"Epygi Quadro 4x","pdate":"01\/07\/2013","pcost":"255.00","pvendor":"eBay: totalcomsolutions","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lockup","adescription":"Epygi Quadro 4x","apo":"","asn":"132342189559","awdate":"","anotes":"Transaction GID: 673414","childCount":"0","a_account":"17800: Telephony Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"217","level":0,"isLeaf":true},{"id":"207","parentid":"38","aname":"QX50 IP PBX","aid":"650","did":"505","pcondition":"n","pdescription":"Epygi QX50 IP-PBX","pdate":"11\/04\/2015","pcost":"725.80","pvendor":"Alloy CP","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"APC 4-Post Rack","adescription":"Epygi QX50 IP-PBX","apo":"","asn":"232344221779","awdate":"","anotes":"Transaction GID: 660454","childCount":"0","a_account":"17800: Telephony Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"38","level":0,"isLeaf":true},{"id":"211","parentid":"221","aname":"Ridgid Belt Sander","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 3-inch Belt Sander (R2740)","pdate":"01\/22\/2017","pcost":"63.00","pvendor":"Home Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 3-inch Belt Sander","apo":"","asn":"CS16383ND13125","awdate":"","anotes":"Transaction GID: 679052","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"210","parentid":"221","aname":"Ridgid Hammer Drill","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 18v 1\/2-inch Brushless Hammer Drill (R86116K)","pdate":"04\/19\/2016","pcost":"191.53","pvendor":"Home Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 1\/2-inch 18v Hammer Drill","apo":"","asn":"CS16055DA90189","awdate":"","anotes":"Transaction GID: 666298","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"32","parentid":"221","aname":"Ridgid Miter Saw","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 12inch Compound Miter Saw (R4120)","pdate":"12\/11\/2012","pcost":"318.04","pvendor":"HomeDepot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 12-inch Compound Miter Saw","apo":"","asn":"Z1230 62009","awdate":"","anotes":"Transaction GID: 95704","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"209","parentid":"221","aname":"Ridgid Nail Gun","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 1\/8in Brad Nailer (R213BNE)","pdate":"07\/12\/2014","pcost":"104.86","pvendor":"Home Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 1\/8-inch Brad Nail Gun","apo":"","asn":"AW140738204","awdate":"","anotes":"Transaction GID: 428101","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"212","parentid":"221","aname":"Ridgid Radio","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 18v Mini-Radio (R84084)","pdate":"04\/19\/2016","pcost":"42.77","pvendor":"Home Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 18v Radio","apo":"","asn":"CA15475D018919","awdate":"","anotes":"Transaction GID: 666298","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"31","parentid":"221","aname":"Ridgid Table Saw","aid":"646","did":"505","pcondition":"n","pdescription":"Ridgid 10inch Table Saw (R45101)","pdate":"12\/11\/2012","pcost":"599.99","pvendor":"HomeDepot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Chance Home","adescription":"Ridgid 10-inch Table Saw","apo":"","asn":"Z1234 13905","awdate":"","anotes":"Transaction GID: 95704","childCount":"0","a_account":"17950: Tools","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"221","level":0,"isLeaf":true},{"id":"208","parentid":"218","aname":"SIPT29G IP-PHONE (Qty 3)","aid":"650","did":"505","pcondition":"n","pdescription":"Yealink SIP-T29G IP Phone","pdate":"11\/04\/2015","pcost":"355.20","pvendor":"Alloy CP","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Office\/Lobby\/Tech","adescription":"Yealink SIP-T29G IP Phone","apo":"","asn":"8129215030201450, 8129215030201451, 8129215030201452","awdate":"","anotes":"Transaction GID: 660454","childCount":"0","a_account":"17800: Telephony Equipment","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"218","level":0,"isLeaf":true},{"id":"1","parentid":"223","aname":"TomTom One XL GPS","aid":"461","did":"505","pcondition":"n","pdescription":"TomTom One XL","pdate":"03\/22\/2009","pcost":"124.99","pvendor":"eBay: eshopic","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"2004 Chevy Astro","adescription":"TomTom One XL","apo":"","asn":"1234567890","awdate":"","anotes":"\u00a0Transaction GID: 670696","childCount":"0","a_account":"17300: Mobile Repair Units","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"223","level":0,"isLeaf":true},{"id":"24","parentid":"216","aname":"Wall Shelving Unit","aid":"412","did":"505","pcondition":"n","pdescription":"Cabinets and shelving joined into single wall unit","pdate":"02\/06\/2012","pcost":"379.43","pvendor":"Home Depot","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Lobby","adescription":"Wall Shelving Unit","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 91925, Original 24inch cabinets, $188.15\nTransaction GID: 667201, Miscellaneous wood shelving and supports to combine cabinets together across tech-wall window\n","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"216","level":0,"isLeaf":true},{"id":"33","parentid":"219","aname":"Workbench","aid":"412","did":"505","pcondition":"n","pdescription":"Miscellaneous components and materials to build u-shaped workbench and workbech island","pdate":"06\/01\/2013","pcost":"754.25","pvendor":"Home Depot\/Walmart","ssold":"n","sdescription":"","sdate":"","sprice":"0.00","sexpense":"0.00","alocation":"Tech","adescription":"Tech Area Workbench & Island","apo":"","asn":"n\/a","awdate":"","anotes":"Transaction GID: 135773,96311,96542,96572,96646,96801,96823,96893,130251,130071,130082,677974,132491,132493,132497,133240,667352","childCount":"0","a_account":"17200: Office Furniture","d_account":"17999: Accumulated Depreciation","loaded":true,"parent":"219","level":0,"isLeaf":true}]} 中进行了设置,因此没有意义。标签之间可以达到的最小间隔是5分钟。 MinuteTimeStepper默认间隔为5、10、15、20和30分钟。

MinuteTimeStepper

它具有一个构造函数,可让您传递自己的列表,但我不知道如何使它起作用。

相反,我只是将其修改为class MinuteTimeStepper extends BaseTimeStepper { static const _defaultIncrements = const [5, 10, 15, 20, 30]; ,现在它以1分钟的间隔绘制标签(如果有可用空间)。

考虑到最接近标签的标签(即使进行了此更改)是每分钟,所以没有必要加上秒。

接受the sample并将系列数据修改为

const [1, 5, 10...

赋予标签以默认格式 new TimeSeriesSales(new DateTime(2018, 8, 22, 13, 00, 00), 15), new TimeSeriesSales(new DateTime(2018, 8, 22, 13, 00, 30), 5), new TimeSeriesSales(new DateTime(2018, 8, 22, 13, 01, 00), 25), new TimeSeriesSales(new DateTime(2018, 8, 22, 13, 01, 30), 20), new TimeSeriesSales(new DateTime(2018, 8, 22, 13, 02, 00), 10), 1 0001(精确为1PM,分别是1分钟和2分钟)读取的标签。 02。请注意,半分钟的点是按预期方式绘制的,但未按预期标记。

如果您想要24小时制,可以添加mm之类的

h mm