Renkoo.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. define("dojox/charting/themes/Renkoo", ["../Theme", "dojox/gfx/gradutils", "./common"], function(Theme, gradutils, themes){
  2. // created by Tom Trenka
  3. var g = Theme.generateGradient,
  4. defaultFill = {type: "linear", space: "shape", x1: 0, y1: 0, x2: 0, y2: 150};
  5. themes.Renkoo = new Theme({
  6. chart: {
  7. fill: "#123666",
  8. pageStyle: {backgroundColor: "#123666", backgroundImage: "none", color: "#95afdb"}
  9. },
  10. plotarea: {
  11. fill: "#123666"
  12. },
  13. axis:{
  14. stroke: { // the axis itself
  15. color: "#95afdb",
  16. width: 1
  17. },
  18. tick: { // used as a foundation for all ticks
  19. color: "#95afdb",
  20. position: "center",
  21. font: "normal normal normal 7pt Lucida Grande, Helvetica, Arial, sans-serif", // labels on axis
  22. fontColor: "#95afdb" // color of labels
  23. }
  24. },
  25. series: {
  26. stroke: {width: 2.5, color: "#123666"},
  27. outline: null,
  28. font: "normal normal normal 8pt Lucida Grande, Helvetica, Arial, sans-serif", // labels on axis
  29. fontColor: "#95afdb"
  30. },
  31. marker: {
  32. stroke: {width: 2.5, color: "#ccc"},
  33. outline: null,
  34. font: "normal normal normal 8pt Lucida Grande, Helvetica, Arial, sans-serif", // labels on axis
  35. fontColor: "#95afdb"
  36. },
  37. seriesThemes: [
  38. {fill: g(defaultFill, "#e7e391", "#f8f7de")},
  39. {fill: g(defaultFill, "#ffb6b6", "#ffe8e8")},
  40. {fill: g(defaultFill, "#bcda7d", "#eef7da")},
  41. {fill: g(defaultFill, "#d5d5d5", "#f4f4f4")},
  42. {fill: g(defaultFill, "#c1e3fd", "#e4f3ff")}
  43. ],
  44. markerThemes: [
  45. {fill: "#fcfcf3", stroke: {color: "#e7e391"}},
  46. {fill: "#fff1f1", stroke: {color: "#ffb6b6"}},
  47. {fill: "#fafdf4", stroke: {color: "#bcda7d"}},
  48. {fill: "#fbfbfb", stroke: {color: "#d5d5d5"}},
  49. {fill: "#f3faff", stroke: {color: "#c1e3fd"}}
  50. ]
  51. });
  52. themes.Renkoo.next = function(elementType, mixin, doPost){
  53. if("slice,column,bar".indexOf(elementType) == -1){
  54. // custom processing to substitute colors
  55. var s = this.seriesThemes[this._current % this.seriesThemes.length];
  56. s.fill.space = "plot";
  57. s.stroke = { width: 2, color: s.fill.colors[0].color};
  58. if(elementType == "line" || elementType == "area"){
  59. s.stroke.width = 4;
  60. }
  61. var theme = Theme.prototype.next.apply(this, arguments);
  62. // cleanup
  63. delete s.stroke;
  64. s.fill.space = "shape";
  65. return theme;
  66. }
  67. return Theme.prototype.next.apply(this, arguments);
  68. };
  69. themes.Renkoo.post = function(theme, elementType){
  70. theme = Theme.prototype.post.apply(this, arguments);
  71. if((elementType == "slice" || elementType == "circle") && theme.series.fill && theme.series.fill.type == "radial"){
  72. theme.series.fill = gradutils.reverse(theme.series.fill);
  73. }
  74. return theme;
  75. };
  76. return themes.Renkoo;
  77. });