Julie.js 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. define("dojox/charting/themes/Julie", ["../Theme", "dojox/gfx/gradutils", "./common"], function(Theme, gradutils){
  2. // created by Julie Santilli (Claro-based theme)
  3. var themes = dojox.charting.themes, g = Theme.generateGradient,
  4. defaultFill = {type: "linear", space: "shape", x1: 0, y1: 0, x2: 0, y2: 100};
  5. themes.Julie = new Theme({
  6. seriesThemes: [
  7. {fill: g(defaultFill, "#59a0bd", "#497c91"), stroke: {color: "#22627d"}}, // blue
  8. {fill: g(defaultFill, "#8d88c7", "#6c6d8e"), stroke: {color: "#8a84c5"}}, // purple
  9. {fill: g(defaultFill, "#85a54a", "#768b4e"), stroke: {color: "#5b6d1f"}}, // green
  10. {fill: g(defaultFill, "#e8e667", "#c6c361"), stroke: {color: "#918e38"}}, // yellow
  11. {fill: g(defaultFill, "#e9c756", "#c7a223"), stroke: {color: "#947b30"}}, // orange
  12. {fill: g(defaultFill, "#a05a5a", "#815454"), stroke: {color: "#572828"}}, // red
  13. {fill: g(defaultFill, "#b17044", "#72543e"), stroke: {color: "#74482e"}}, // brown
  14. {fill: g(defaultFill, "#a5a5a5", "#727272"), stroke: {color: "#535353"}}, // grey
  15. {fill: g(defaultFill, "#9dc7d9", "#59a0bd"), stroke: {color: "#22627d"}}, // blue
  16. {fill: g(defaultFill, "#b7b3da", "#8681b3"), stroke: {color: "#8a84c5"}}, // purple
  17. {fill: g(defaultFill, "#a8c179", "#85a54a"), stroke: {color: "#5b6d1f"}}, // green
  18. {fill: g(defaultFill, "#eeea99", "#d6d456"), stroke: {color: "#918e38"}}, // yellow
  19. {fill: g(defaultFill, "#ebcf81", "#e9c756"), stroke: {color: "#947b30"}}, // orange
  20. {fill: g(defaultFill, "#c99999", "#a05a5a"), stroke: {color: "#572828"}}, // red
  21. {fill: g(defaultFill, "#c28b69", "#7d5437"), stroke: {color: "#74482e"}}, // brown
  22. {fill: g(defaultFill, "#bebebe", "#8c8c8c"), stroke: {color: "#535353"}}, // grey
  23. {fill: g(defaultFill, "#c7e0e9", "#92baca"), stroke: {color: "#22627d"}}, // blue
  24. {fill: g(defaultFill, "#c9c6e4", "#ada9d6"), stroke: {color: "#8a84c5"}}, // purple
  25. {fill: g(defaultFill, "#c0d0a0", "#98ab74"), stroke: {color: "#5b6d1f"}}, // green
  26. {fill: g(defaultFill, "#f0eebb", "#dcd87c"), stroke: {color: "#918e38"}}, // yellow
  27. {fill: g(defaultFill, "#efdeb0", "#ebcf81"), stroke: {color: "#947b30"}}, // orange
  28. {fill: g(defaultFill, "#ddc0c0", "#c99999"), stroke: {color: "#572828"}}, // red
  29. {fill: g(defaultFill, "#cfb09b", "#c28b69"), stroke: {color: "#74482e"}}, // brown
  30. {fill: g(defaultFill, "#d8d8d8", "#bebebe"), stroke: {color: "#535353"}}, // grey
  31. {fill: g(defaultFill, "#ddeff5", "#a5c4cd"), stroke: {color: "#22627d"}}, // blue
  32. {fill: g(defaultFill, "#dedcf0", "#b3afd3"), stroke: {color: "#8a84c5"}}, // purple
  33. {fill: g(defaultFill, "#dfe9ca", "#c0d0a0"), stroke: {color: "#5b6d1f"}}, // green
  34. {fill: g(defaultFill, "#f8f7db", "#e5e28f"), stroke: {color: "#918e38"}}, // yellow
  35. {fill: g(defaultFill, "#f7f0d8", "#cfbd88"), stroke: {color: "#947b30"}}, // orange
  36. {fill: g(defaultFill, "#eedede", "#caafaf"), stroke: {color: "#572828"}}, // red
  37. {fill: g(defaultFill, "#e3cdbf", "#cfb09b"), stroke: {color: "#74482e"}}, // brown
  38. {fill: g(defaultFill, "#efefef", "#cacaca"), stroke: {color: "#535353"}} // grey
  39. ]
  40. });
  41. themes.Julie.next = function(elementType, mixin, doPost){
  42. if(elementType == "line" || elementType == "area"){
  43. var s = this.seriesThemes[this._current % this.seriesThemes.length];
  44. s.fill.space = "plot";
  45. var theme = Theme.prototype.next.apply(this, arguments);
  46. s.fill.space = "shape";
  47. return theme;
  48. }
  49. return Theme.prototype.next.apply(this, arguments);
  50. };
  51. themes.Julie.post = function(theme, elementType){
  52. theme = Theme.prototype.post.apply(this, arguments);
  53. if(elementType == "slice" && theme.series.fill && theme.series.fill.type == "radial"){
  54. theme.series.fill = gradutils.reverse(theme.series.fill);
  55. }
  56. return theme;
  57. };
  58. return themes.Julie;
  59. });