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.

51 lines
1.3 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. function generateData(){
  8. var data = [];
  9. for(var i = 0; i < 12; ++i){
  10. data.push([Date.monthNames[i], (Math.floor(Math.random() * 11) + 1) * 100]);
  11. }
  12. return data;
  13. }
  14. Ext.onReady(function(){
  15. var store = new Ext.data.ArrayStore({
  16. fields: ['month', 'hits'],
  17. data: generateData()
  18. });
  19. new Ext.Panel({
  20. width: 700,
  21. height: 400,
  22. renderTo: document.body,
  23. title: 'Column Chart with Reload - Hits per Month',
  24. tbar: [{
  25. text: 'Load new data set',
  26. handler: function(){
  27. store.loadData(generateData());
  28. }
  29. }],
  30. items: {
  31. xtype: 'columnchart',
  32. store: store,
  33. yField: 'hits',
  34. url: '../../resources/charts.swf',
  35. xField: 'month',
  36. xAxis: new Ext.chart.CategoryAxis({
  37. title: 'Month'
  38. }),
  39. yAxis: new Ext.chart.NumericAxis({
  40. title: 'Hits'
  41. }),
  42. extraStyle: {
  43. xAxis: {
  44. labelRotation: -90
  45. }
  46. }
  47. }
  48. });
  49. });