summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/charting/themes/Renkoo.xd.js
blob: 88c1b4cb8a48934c1359677b3e90f6cb2e17f478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


dojo._xdResourceLoaded(function(dojo, dijit, dojox){
return {depends: [["provide", "dojox.charting.themes.Renkoo"],
["require", "dojox.gfx.gradutils"],
["require", "dojox.charting.Theme"]],
defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.themes.Renkoo"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojox.charting.themes.Renkoo"] = true;
dojo.provide("dojox.charting.themes.Renkoo");

dojo.require("dojox.gfx.gradutils");
dojo.require("dojox.charting.Theme");

// created by Tom Trenka

(function(){
	var dc = dojox.charting, themes = dc.themes, Theme = dc.Theme, g = Theme.generateGradient,
		defaultFill = {type: "linear", space: "shape", x1: 0, y1: 0, x2: 0, y2: 150};
	
	themes.Renkoo = new dc.Theme({
		chart: {
			fill:      "#123666",
			pageStyle: {backgroundColor: "#123666", backgroundImage: "none", color: "#95afdb"}
		},
		plotarea: {
			fill: "#123666"
		},
		axis:{
			stroke:	{ // the axis itself
				color: "#95afdb",
				width: 1
			},
			tick: {	// used as a foundation for all ticks
				color:     "#95afdb",
				position:  "center",
				font:      "normal normal normal 7pt Lucida Grande, Helvetica, Arial, sans-serif",	// labels on axis
				fontColor: "#95afdb"								// color of labels
			}
		},
		series: {
			stroke:  {width: 2.5, color: "#123666"},
			outline: null,
			font:      "normal normal normal 8pt Lucida Grande, Helvetica, Arial, sans-serif",	// labels on axis
			fontColor: "#95afdb"
		},
		marker: {
			stroke:  {width: 2.5, color: "#ccc"},
			outline: null,
			font:      "normal normal normal 8pt Lucida Grande, Helvetica, Arial, sans-serif",	// labels on axis
			fontColor: "#95afdb"
		},
		seriesThemes: [
			{fill: g(defaultFill, "#e7e391", "#f8f7de")},
			{fill: g(defaultFill, "#ffb6b6", "#ffe8e8")},
			{fill: g(defaultFill, "#bcda7d", "#eef7da")},
			{fill: g(defaultFill, "#d5d5d5", "#f4f4f4")},
			{fill: g(defaultFill, "#c1e3fd", "#e4f3ff")}
		],
		markerThemes: [
			{fill: "#fcfcf3", stroke: {color: "#e7e391"}},
			{fill: "#fff1f1", stroke: {color: "#ffb6b6"}},
			{fill: "#fafdf4", stroke: {color: "#bcda7d"}},
			{fill: "#fbfbfb", stroke: {color: "#d5d5d5"}},
			{fill: "#f3faff", stroke: {color: "#c1e3fd"}}
		]
	});
	
	themes.Renkoo.next = function(elementType, mixin, doPost){
		if("slice,column,bar".indexOf(elementType) == -1){
			// custom processing to substitute colors
			var s = this.seriesThemes[this._current % this.seriesThemes.length];
			s.fill.space = "plot";
			s.stroke  = { width: 2, color: s.fill.colors[0].color};
			if(elementType == "line" || elementType == "area"){
				s.stroke.width = 4;
			}
			var theme = Theme.prototype.next.apply(this, arguments);
			// cleanup
			delete s.stroke;
			s.fill.space = "shape";
			return theme;
		}
		return Theme.prototype.next.apply(this, arguments);
	};
	
	themes.Renkoo.post = function(theme, elementType){
		theme = Theme.prototype.post.apply(this, arguments);
		if((elementType == "slice" || elementType == "circle") && theme.series.fill && theme.series.fill.type == "radial"){
			theme.series.fill = dojox.gfx.gradutils.reverse(theme.series.fill);
		}
		return theme;
	};
})();

}

}};});