420b27d78daa4741b7c2f16433176ad1ea8e81e5.svn-base 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. $(function() {
  2. "use strict";
  3. BWA.ChartOptions = BWA.ChartOptions || {};
  4. var A = BWA.ChartOptions.MainDashBoard = BWA.ChartOptions.MainDashBoard || {};
  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. format: 'fixedPoint',
  39. precision: 2,
  40. visible: true,
  41. connector: {
  42. visible: true
  43. },
  44. customizeText: function(pointInfo) {
  45. //return pointInfo.argumentText;
  46. return pointInfo.percentText; //
  47. }
  48. }
  49. }
  50. ]
  51. };
  52. };
  53. });