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.

155 lines
4.8 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.chart.Chart.CHART_URL = '../../resources/charts.swf';
  8. Ext.onReady(function(){
  9. var store = new Ext.data.JsonStore({
  10. fields:['name', 'visits', 'views'],
  11. data: [
  12. {name:'Jul 07', visits: 245000, views: 3000000},
  13. {name:'Aug 07', visits: 240000, views: 3500000},
  14. {name:'Sep 07', visits: 355000, views: 4000000},
  15. {name:'Oct 07', visits: 375000, views: 4200000},
  16. {name:'Nov 07', visits: 490000, views: 4500000},
  17. {name:'Dec 07', visits: 495000, views: 5800000},
  18. {name:'Jan 08', visits: 520000, views: 6000000},
  19. {name:'Feb 08', visits: 620000, views: 7500000}
  20. ]
  21. });
  22. // extra extra simple
  23. new Ext.Panel({
  24. title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',
  25. renderTo: 'container',
  26. width:500,
  27. height:300,
  28. layout:'fit',
  29. items: {
  30. xtype: 'linechart',
  31. store: store,
  32. xField: 'name',
  33. yField: 'visits',
  34. listeners: {
  35. itemclick: function(o){
  36. var rec = store.getAt(o.index);
  37. Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
  38. }
  39. }
  40. }
  41. });
  42. // extra simple
  43. new Ext.Panel({
  44. iconCls:'chart',
  45. title: 'ExtJS.com Visits Trend, 2007/2008 (Simple styling)',
  46. frame:true,
  47. renderTo: 'container',
  48. width:500,
  49. height:300,
  50. layout:'fit',
  51. items: {
  52. xtype: 'linechart',
  53. store: store,
  54. url: '../../resources/charts.swf',
  55. xField: 'name',
  56. yField: 'visits',
  57. yAxis: new Ext.chart.NumericAxis({
  58. displayName: 'Visits',
  59. labelRenderer : Ext.util.Format.numberRenderer('0,0')
  60. }),
  61. tipRenderer : function(chart, record){
  62. return Ext.util.Format.number(record.data.visits, '0,0') + ' visits in ' + record.data.name;
  63. }
  64. }
  65. });
  66. // more complex with a custom look
  67. new Ext.Panel({
  68. iconCls:'chart',
  69. title: 'ExtJS.com Visits and Pageviews, 2007/2008 (Full styling)',
  70. frame:true,
  71. renderTo: 'container',
  72. width:500,
  73. height:300,
  74. layout:'fit',
  75. items: {
  76. xtype: 'columnchart',
  77. store: store,
  78. url:'../../resources/charts.swf',
  79. xField: 'name',
  80. yAxis: new Ext.chart.NumericAxis({
  81. displayName: 'Visits',
  82. labelRenderer : Ext.util.Format.numberRenderer('0,0')
  83. }),
  84. tipRenderer : function(chart, record, index, series){
  85. if(series.yField == 'visits'){
  86. return Ext.util.Format.number(record.data.visits, '0,0') + ' visits in ' + record.data.name;
  87. }else{
  88. return Ext.util.Format.number(record.data.views, '0,0') + ' page views in ' + record.data.name;
  89. }
  90. },
  91. chartStyle: {
  92. padding: 10,
  93. animationEnabled: true,
  94. font: {
  95. name: 'Tahoma',
  96. color: 0x444444,
  97. size: 11
  98. },
  99. dataTip: {
  100. padding: 5,
  101. border: {
  102. color: 0x99bbe8,
  103. size:1
  104. },
  105. background: {
  106. color: 0xDAE7F6,
  107. alpha: .9
  108. },
  109. font: {
  110. name: 'Tahoma',
  111. color: 0x15428B,
  112. size: 10,
  113. bold: true
  114. }
  115. },
  116. xAxis: {
  117. color: 0x69aBc8,
  118. majorTicks: {color: 0x69aBc8, length: 4},
  119. minorTicks: {color: 0x69aBc8, length: 2},
  120. majorGridLines: {size: 1, color: 0xeeeeee}
  121. },
  122. yAxis: {
  123. color: 0x69aBc8,
  124. majorTicks: {color: 0x69aBc8, length: 4},
  125. minorTicks: {color: 0x69aBc8, length: 2},
  126. majorGridLines: {size: 1, color: 0xdfe8f6}
  127. }
  128. },
  129. series: [{
  130. type: 'column',
  131. displayName: 'Page Views',
  132. yField: 'views',
  133. style: {
  134. image:'bar.gif',
  135. mode: 'stretch',
  136. color:0x99BBE8
  137. }
  138. },{
  139. type:'line',
  140. displayName: 'Visits',
  141. yField: 'visits',
  142. style: {
  143. color: 0x15428B
  144. }
  145. }]
  146. }
  147. });
  148. });