source: Dev/branches/rest-dojo-ui/client/dojox/charting/themes/Julie.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

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