Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.onReady(function() {
  8. var SaleRecord = Ext.data.Record.create([
  9. {name: 'person', type: 'string'},
  10. {name: 'product', type: 'string'},
  11. {name: 'city', type: 'string'},
  12. {name: 'state', type: 'string'},
  13. {name: 'month', type: 'int'},
  14. {name: 'quarter', type: 'int'},
  15. {name: 'year', type: 'int'},
  16. {name: 'quantity', type: 'int'},
  17. {name: 'value', type: 'int'}
  18. ]);
  19. var myStore = new Ext.data.Store({
  20. url: 'simple.json',
  21. autoLoad: true,
  22. reader: new Ext.data.JsonReader({
  23. root: 'rows',
  24. idProperty: 'id'
  25. }, SaleRecord)
  26. });
  27. var pivotGrid = new Ext.grid.PivotGrid({
  28. title : 'PivotGrid example',
  29. width : 800,
  30. height : 259,
  31. renderTo : 'docbody',
  32. store : myStore,
  33. aggregator: 'sum',
  34. measure : 'value',
  35. viewConfig: {
  36. title: 'Sales Performance'
  37. },
  38. leftAxis: [
  39. {
  40. width: 80,
  41. dataIndex: 'person'
  42. },
  43. {
  44. width: 90,
  45. dataIndex: 'product'
  46. }
  47. ],
  48. topAxis: [
  49. {
  50. dataIndex: 'year'
  51. },
  52. {
  53. dataIndex: 'city'
  54. }
  55. ]
  56. });
  57. });