f90e1285fc85a1893b03934612f3249f47547611.svn-base 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $(function() {
  2. "use strict";
  3. BWA.ChartOptions = BWA.ChartOptions || {};
  4. var A = BWA.ChartOptions.CenterMainDashboard = BWA.ChartOptions.CenterMainDashboard || {};
  5. A.getUsageRatioByEnergyChartOptions = function() {
  6. return {
  7. palette: "Default",
  8. legend: {
  9. horizontalAlignment: "center",
  10. verticalAlignment: "bottom",
  11. margin: 10,
  12. border: {
  13. visible: true
  14. }
  15. },
  16. tooltip: {
  17. enabled: true,
  18. format: 'fixedPoint',
  19. precision: 2,
  20. customizeTooltip: function(point) {
  21. return {
  22. text: [this.argumentText, ': ', this.valueText].join('')
  23. };
  24. }
  25. },
  26. pointClick: function(point) {
  27. point.select();
  28. },
  29. series: [
  30. {
  31. type: "doughnut", // if not, pie.
  32. argumentField: "energy",
  33. valueField: "value",
  34. hoverStyle: {
  35. color: "#ffd700"
  36. },
  37. label: {
  38. visible: true,
  39. connector: {
  40. visible: true
  41. },
  42. customizeText: function(pointInfo) {
  43. return pointInfo.argumentText;
  44. }
  45. }
  46. }
  47. ]
  48. };
  49. };
  50. });