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
103
104
105
106
107
108
109
110
111
112
113
114
115
| {
| "Version":"6.8.1.0",
| "Title":"8g.图表.脚本.自定义颜色",
| "Author":"锐浪报表软件",
| "Description":"利用报表脚本实现图表图形显示颜色的自定义,也可以在事件响应函数中做类似的任务。",
| "Font":{
| "Name":"宋体",
| "Size":105000,
| "Weight":400,
| "Charset":134
| },
| "InitializeScript":"var chart1 = Report.ControlByName(\"Chart1\").AsChart;\r\n\r\n//自定义图表的填充颜色\r\n\r\n//首先清除原来的颜色定义\r\nchart1.EmptyFillColors(); \r\n\r\n//依次加入各个序列的显示颜色\r\nchart1.AddFillColor(ColorFromRGB(64, 64, 255));\r\nchart1.AddFillColor(ColorFromRGB(128, 128, 255));\r\nchart1.AddFillColor(ColorFromRGB(196, 196, 255));\r\nchart1.AddFillColor(ColorFromRGB(64, 64, 64));\r\nchart1.AddFillColor(ColorFromRGB(128, 128, 128));\r\nchart1.AddFillColor(ColorFromRGB(196, 196, 196));\r\n\r\nfunction ColorFromRGB(r, g, b) {\r\n return Report.Utility.ColorFromRGB(r, g, b);\r\n}",
| "ConnectionString":"Provider=Microsoft.Jet.OLEDB.4.0;\r\nUser ID=Admin;\r\nData Source=..\\Data\\Northwind.mdb",
| "Printer":{
| "LeftMargin":1.5,
| "TopMargin":1.5,
| "RightMargin":1.5,
| "BottomMargin":1.5
| },
| "ReportHeader":[
| {
| "Name":"ReportHeader2",
| "Height":1.5875,
| "Font":{
| "Name":"宋体",
| "Size":157500,
| "Bold":true,
| "Charset":134
| },
| "Control":[
| {
| "Type":"StaticBox",
| "Name":"StaticBox1",
| "Left":0.211667,
| "Top":0.211667,
| "Width":17.3831,
| "Height":0.978958,
| "TextAlign":"MiddleCenter",
| "Text":"利用报表脚本实现图表图形显示颜色的自定义"
| }
| ]
| },
| {
| "Name":"ReportHeader1",
| "Height":10.0013,
| "Control":[
| {
| "Type":"Chart",
| "Name":"Chart1",
| "Dock":"Fill",
| "Title":"自定义图表序列颜色",
| "TitleFont":{
| "Name":"宋体",
| "Size":120000,
| "Bold":true,
| "Charset":134
| },
| "GroupCount":4,
| "SeriesCount":3,
| "BarWidthPercent":85,
| "SeriesField":"ProductName",
| "GroupField":"Region",
| "GroupLabel":"一\r二\r三\r四",
| "SeriesLabel":"张三\r李四\r王五",
| "Value":"1000,1200,1500,800,1500,1800,2000,1200,800,1000,700,500",
| "Recordset":{
| "QuerySQL":"select c.Region, d.ProductID,p.ProductName,\r\nsum(d.UnitPrice*d.Quantity) as Amount\r\nfrom (Orders m inner join \r\n(OrderDetails d inner join Products p on P.ProductID=D.ProductID) on \r\r\nm.OrderId=d.OrderId)\r\nleft join Customers c on c.CustomerID=m.CustomerID\r\nwhere d.ProductID in (1,10,11,21) and m.OrderDate between \r\r\n#1997/1/1# and #1997/12/31#\r\ngroup by c.Region,d.ProductID,p.ProductName\r\norder by d.ProductID,c.Region",
| "Field":[
| {
| "Name":"Region"
| },
| {
| "Name":"ProductID",
| "Type":"Integer"
| },
| {
| "Name":"ProductName"
| },
| {
| "Name":"Amount",
| "Type":"Currency"
| }
| ]
| },
| "XAxis":{
| "Label":"季度",
| "TextFormat":"0.##",
| "CoordLinePen":{
| "Color":"FFFF00"
| }
| },
| "YAxis":{
| "Label":"销售额",
| "TextFormat":"0.##",
| "CoordLinePen":{
| "Color":"FFFF00"
| }
| },
| "Y2Axis":{
| "TextFormat":"0.##",
| "CoordLinePen":{
| "Color":"FFC4C4"
| }
| },
| "ChartSeries":[
| {
| "YValueField":"Amount",
| "ValueFormat":"0.00,"
| }
| ]
| }
| ]
| }
| ]
| }
|
|