init
This commit is contained in:
152
include/ECM/open_flash_chart2/data-files/3.html
Normal file
152
include/ECM/open_flash_chart2/data-files/3.html
Normal file
@@ -0,0 +1,152 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<script type="text/javascript" src="../js/json/json2.js"></script>
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function ofc_ready()
|
||||
{
|
||||
alert('ofc_ready');
|
||||
//load();
|
||||
}
|
||||
|
||||
function open_flash_chart_data()
|
||||
{
|
||||
alert( 'reading data' );
|
||||
return JSON.stringify(chart);
|
||||
}
|
||||
|
||||
function load_1()
|
||||
{
|
||||
tmp = findSWF("my_chart");
|
||||
x = tmp.load( JSON.stringify(chart) );
|
||||
}
|
||||
|
||||
function load_2()
|
||||
{
|
||||
tmp = findSWF("my_chart");
|
||||
x = tmp.load( JSON.stringify(chart2) );
|
||||
}
|
||||
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
var chart = {
|
||||
"title":{
|
||||
"text": "Many data lines",
|
||||
"style": "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"
|
||||
},
|
||||
|
||||
"y_legend":{
|
||||
"text": "Open Flash Chart",
|
||||
"style": "{color: #736AFF; font-size: 12px;}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#9933CC",
|
||||
"text": "Page views",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,7]
|
||||
},
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#CC9933",
|
||||
"text": "Page views 2",
|
||||
"font-size": 10,
|
||||
"values" : [6,7,9,5,7,6,9,7,3]
|
||||
}
|
||||
],
|
||||
|
||||
"x_axis":{
|
||||
"stroke":1,
|
||||
"tick_height":10,
|
||||
"colour":"#d000d0",
|
||||
"grid_colour":"#00ff00",
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
|
||||
"y_axis":{
|
||||
"stroke": 4,
|
||||
"tick_length": 3,
|
||||
"colour": "#d000d0",
|
||||
"grid_colour": "#00ff00",
|
||||
"offset": 0,
|
||||
"max": 20
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var chart2 = {
|
||||
"title":{
|
||||
"text": "Sketch",
|
||||
"style": "{font-size:35px; color: #567300}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar_sketch",
|
||||
"colour": "#81AC00",
|
||||
"outline-colour": "#567300",
|
||||
"text": "Sketch",
|
||||
"font-size": 10,
|
||||
"offset": 6,
|
||||
"values" : [
|
||||
3,
|
||||
8,
|
||||
-5,
|
||||
{"top":5,"outline-colour": "#7030A0", "tip": "outline"},
|
||||
4,
|
||||
{"top":5, "colour": "#99FF00", "tip": "colour"},
|
||||
{"top":-3,"colour": "#99FF00", "outline-colour": "#7030A0", "tip": "colour + outline"},
|
||||
2,
|
||||
7.5]
|
||||
}
|
||||
],
|
||||
|
||||
"x_axis":{
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
|
||||
"y_axis":{
|
||||
"min": -10,
|
||||
"max": 10
|
||||
},
|
||||
|
||||
"tooltip":{
|
||||
"text": "My Tip<br>#top#,#bottom# = #val#"
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
alert( chart );
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
swfobject.embedSWF("../open-flash-chart/open-flash-chart.swf", "my_chart", "450", "300", "9.0.0");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<INPUT TYPE=BUTTON OnClick="load_1();" VALUE="Chart 1">
|
||||
<INPUT TYPE=BUTTON OnClick="load_2();" VALUE="Chart 2">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
55
include/ECM/open_flash_chart2/data-files/4.html
Normal file
55
include/ECM/open_flash_chart2/data-files/4.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var so = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "300", "200", "9", "#FFFFFF");
|
||||
//so.addVariable("data", "../data-files/data-20.txt");
|
||||
|
||||
so.addVariable("variables","true");
|
||||
|
||||
|
||||
so.addVariable("pie", "60,#9933CC,#000000");
|
||||
so.addVariable("values", "3,2,1,1,1,1,0.2");
|
||||
so.addVariable("colours", "#d01f3c,#356aa0,#C79810");
|
||||
so.addVariable("links", "javascript:alert('Jan 3'),javascript:alert('中文 2'),javascript:alert('March 1'),javascript:alert('April 1'),javascript:alert('May 1'),javascript:alert('June 1'),javascript:alert('July 0.2')");
|
||||
so.addVariable("pie_labels", "January,中文,March,April,May,June,July");
|
||||
so.addVariable("tool_tip", "中文<br>#x_label#<br>Value: #val#");
|
||||
|
||||
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
<hr>
|
||||
|
||||
<div id="my_chart_2"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var so = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "200", "300", "9", "#FFFFFF");
|
||||
//so.addVariable("data", "../data-files/data-20.txt");
|
||||
|
||||
so.addVariable("variables","true");
|
||||
|
||||
|
||||
so.addVariable("pie", "60,#9933CC,#000000");
|
||||
so.addVariable("values", "3,2,1,1,1,1,0.2");
|
||||
so.addVariable("colours", "#d01f3c,#356aa0,#C79810");
|
||||
so.addVariable("links", "javascript:alert('Jan 3'),javascript:alert('中文 2'),javascript:alert('March 1'),javascript:alert('April 1'),javascript:alert('May 1'),javascript:alert('June 1'),javascript:alert('July 0.2')");
|
||||
so.addVariable("pie_labels", "January,中文,March,April,May,June,July");
|
||||
so.addVariable("tool_tip", "中文<br>#x_label#<br>Value: #val#");
|
||||
|
||||
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart_2");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
39
include/ECM/open_flash_chart2/data-files/5.html
Normal file
39
include/ECM/open_flash_chart2/data-files/5.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var my_chart = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "300", "200", "9", "#FFFFFF");
|
||||
|
||||
my_chart.addVariable("variables","true");
|
||||
my_chart.addVariable("title","report,{font-size: 16;}");
|
||||
my_chart.addVariable("y_legend","data,12,0x736AFF");
|
||||
my_chart.addVariable("y_label_size","14");
|
||||
my_chart.addVariable("y_ticks","5,10,4");
|
||||
|
||||
my_chart.addVariable("bar","50,0x9933CC,q,10");
|
||||
my_chart.addVariable("line_dot_2","3,#CC3399,Line,10,5");
|
||||
|
||||
my_chart.addVariable("values","29,62,58,27");
|
||||
my_chart.addVariable("values_2","39,72,68,37");
|
||||
|
||||
my_chart.addVariable("x_labels","2004,2005,2006,2007");
|
||||
|
||||
my_chart.addVariable("x_axis_steps","2");
|
||||
my_chart.addVariable("y_max","80");
|
||||
my_chart.write("my_chart");
|
||||
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
39
include/ECM/open_flash_chart2/data-files/6.html
Normal file
39
include/ECM/open_flash_chart2/data-files/6.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var my_chart = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "300", "200", "9", "#FFFFFF");
|
||||
|
||||
my_chart.addVariable("variables","true");
|
||||
my_chart.addVariable("title","report,{font-size: 16;}");
|
||||
my_chart.addVariable("y_legend","data,12,0x736AFF");
|
||||
my_chart.addVariable("y_label_size","14");
|
||||
my_chart.addVariable("y_ticks","5,10,4");
|
||||
|
||||
my_chart.addVariable("bar","50,0x9933CC,q,10");
|
||||
my_chart.addVariable("line_dot_2","3,#CC3399,Line,10,5");
|
||||
|
||||
my_chart.addVariable("values","29,62,58,27");
|
||||
my_chart.addVariable("values_2","39,72,68,37");
|
||||
|
||||
my_chart.addVariable("x_labels","2004,2005,2006,2007");
|
||||
|
||||
my_chart.addVariable("x_axis_steps","2");
|
||||
my_chart.addVariable("y_max","80");
|
||||
my_chart.write("my_chart");
|
||||
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
43
include/ECM/open_flash_chart2/data-files/7.html
Normal file
43
include/ECM/open_flash_chart2/data-files/7.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var d = Date.parse("Jul 8, 2005")-Date.parse("Jul 9, 2005");
|
||||
alert(d);
|
||||
|
||||
var d = Date.parse("Jul 8, 2005");
|
||||
alert(d);
|
||||
|
||||
var d2 = Date.parse("Jul 8, 2006") - d;
|
||||
alert(d2);
|
||||
var so = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "300", "200", "9", "#FFFFFF");
|
||||
|
||||
|
||||
|
||||
so.addVariable("variables","true");
|
||||
so.addVariable("scatter","3,0x004040,Dataset1,10");
|
||||
so.addVariable("y_min", "0");
|
||||
so.addVariable("y_max", 200);
|
||||
so.addVariable("x_min", d);
|
||||
so.addVariable("x_max", d2);
|
||||
so.addVariable("values","[" + (Date.parse("Jul 8, 2005")-d) + ",100,5],[" + ((Date.parse("Jul 8, 2005")+4)-d) + ",150,5]");
|
||||
//so.addVariable("x_labels",Date.parse("Jul 8, 2005")+",x,y,z,"+Date.parse("Jul 8, 2006") );
|
||||
so.addVariable("x_labels","Jul 8, 2005,x,y,z,Jul 8, 2006");
|
||||
so.addVariable("x_axis_steps","86400000")&
|
||||
so.addVariable("tool_tip","x:#x_label#<br>y:#val#");
|
||||
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
34
include/ECM/open_flash_chart2/data-files/8.html
Normal file
34
include/ECM/open_flash_chart2/data-files/8.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var so = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "470", "280", "9", "#FFFFFF");
|
||||
so.addVariable("variables","true");
|
||||
so.addVariable("x_axis_steps","1");
|
||||
so.addVariable("y_ticks","5,10,5");
|
||||
so.addVariable("line","3,#87421F");
|
||||
so.addVariable("y_min","0");
|
||||
so.addVariable("y_max","20");
|
||||
so.addVariable("pie","60,#E4F0DB,#000000,1,,1");
|
||||
so.addVariable("values","1,1");
|
||||
so.addVariable("pie_labels","Germany,Spain");
|
||||
so.addVariable("bg_colour","#ffffff");
|
||||
so.addVariable("colours","#d01f3c,#356aa0,#C79810");
|
||||
so.addVariable("links","javascript:alert('12'),javascript:alert('10'),javascript:alert('10'),javascript:alert('11'),javascript:alert('6')");
|
||||
so.addVariable("tool_tip","#x_label#<br>Followers:#val#");
|
||||
|
||||
so.addVariable("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
32
include/ECM/open_flash_chart2/data-files/flash-variable.html
Normal file
32
include/ECM/open_flash_chart2/data-files/flash-variable.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function ofc_ready()
|
||||
{
|
||||
alert('ofc_ready');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var so = new SWFObject("../open-flash-chart/open-flash-chart.swf", "ofc", "250", "200", "9", "#FFFFFF");
|
||||
so.addVariable("data-file", "../data-files/data-60.txt");
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
|
||||
</script>
|
||||
|
||||
<div>boo</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
43
include/ECM/open_flash_chart2/data-files/json-example.html
Normal file
43
include/ECM/open_flash_chart2/data-files/json-example.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function load()
|
||||
{
|
||||
tmp = findSWF("ofc");
|
||||
x = tmp.load('{"title":{"text":"hello"}, "x_axis":{"max":6},"elements":[{"type":"line","text":"moo","font-size":10,"values":[5,8,9,4,7,8]}]}');
|
||||
}
|
||||
|
||||
function onrollout2()
|
||||
{
|
||||
tmp = findSWF("ofc");
|
||||
x = tmp.rollout();
|
||||
}
|
||||
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
|
||||
<div id="my_chart" style="padding: 0px; margin:10px; border: 1px solid lightblue; width: 250px; height: 200px;" onmouseout="__onrollout();"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var so = new SWFObject("../open-flash-chart/open-flash-chart.swf", "ofc", "250", "200", "9", "#FFFFFF");
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
<input type="submit" onclick="javascript:load()" value="go">
|
||||
</body>
|
||||
</html>
|
||||
131
include/ECM/open_flash_chart2/data-files/json-test-2.html
Normal file
131
include/ECM/open_flash_chart2/data-files/json-test-2.html
Normal file
@@ -0,0 +1,131 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
<script type="text/javascript" src="../js/json/json2.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function ofc_ready()
|
||||
{
|
||||
alert('ofc_ready');
|
||||
tmp = findSWF("ofc");
|
||||
x = tmp.load( JSON.stringify(data) );
|
||||
}
|
||||
|
||||
|
||||
function button_click()
|
||||
{
|
||||
tmp = findSWF("ofc");
|
||||
x = tmp.load( JSON.stringify(data_2) );
|
||||
}
|
||||
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
var data = {
|
||||
|
||||
"title_":{
|
||||
"text":"Custom tooltip",
|
||||
"style":"{font-size: 20px; font-family: Verdana; text-align: center;}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar",
|
||||
"colour": "#9933CC",
|
||||
"text": "Page views",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,9]
|
||||
}
|
||||
],
|
||||
"x_axis":{
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
"y_axis":{
|
||||
"max":20
|
||||
},
|
||||
"tooltip":{
|
||||
"shadow":false,
|
||||
"stroke":5,
|
||||
"colour":"#00d000",
|
||||
"background":"#d0d0ff",
|
||||
"title":"{font-size: 14px; color: #905050;}",
|
||||
"body":"{font-size: 10px; font-weight: bold; color: #9090ff;}"
|
||||
}
|
||||
}
|
||||
|
||||
var data_2 = {
|
||||
"title":{
|
||||
"text": "Many data lines",
|
||||
"style": "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"
|
||||
},
|
||||
|
||||
"y_legend":{
|
||||
"text": "Open Flash Chart",
|
||||
"style": "{color: #736AFF; font-size: 12px;}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#9933CC",
|
||||
"text": "Page views",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,7]
|
||||
},
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#CC9933",
|
||||
"text": "Page views 2",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,7]
|
||||
}
|
||||
],
|
||||
|
||||
"x_axis":{
|
||||
"stroke":1,
|
||||
"tick_height":10,
|
||||
"colour":"#d000d0",
|
||||
"grid_colour":"#00ff00",
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
|
||||
"y_axis":{
|
||||
"stroke": 4,
|
||||
"tick_length": 3,
|
||||
"colour": "#d000d0",
|
||||
"grid_colour": "#00ff00",
|
||||
"offset": 0,
|
||||
"max": 20
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var so = new SWFObject("../open-flash-chart/open-flash-chart.swf?p=moo", "ofc", "300", "250", "9", "#FFFFFF");
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
<a href="javascript:button_click()">load json</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
136
include/ECM/open_flash_chart2/data-files/json-test.html
Normal file
136
include/ECM/open_flash_chart2/data-files/json-test.html
Normal file
@@ -0,0 +1,136 @@
|
||||
<html><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<script type="text/javascript" src="../js/swfobject.js"></script>
|
||||
<script type="text/javascript" src="../js/json/json2.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function ofc_ready()
|
||||
{
|
||||
alert('ofc_ready');
|
||||
// tmp = findSWF("ofc");
|
||||
// x = tmp.load( JSON.stringify(data) );
|
||||
}
|
||||
|
||||
function open_flash_chart_data()
|
||||
{
|
||||
alert( 'reading data' );
|
||||
return JSON.stringify(data);
|
||||
}
|
||||
|
||||
function load()
|
||||
{
|
||||
tmp = findSWF("ofc");
|
||||
x = tmp.load( JSON.stringify(data_2) );
|
||||
}
|
||||
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
var data = {
|
||||
|
||||
"title_":{
|
||||
"text":"Custom tooltip",
|
||||
"style":"{font-size: 20px; font-family: Verdana; text-align: center;}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar",
|
||||
"colour": "#9933CC",
|
||||
"text": "Page views",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,9]
|
||||
}
|
||||
],
|
||||
"x_axis":{
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
"y_axis":{
|
||||
"max":20
|
||||
},
|
||||
"tooltip":{
|
||||
"shadow":false,
|
||||
"stroke":5,
|
||||
"colour":"#00d000",
|
||||
"background":"#d0d0ff",
|
||||
"title":"{font-size: 14px; color: #905050;}",
|
||||
"body":"{font-size: 10px; font-weight: bold; color: #9090ff;}"
|
||||
}
|
||||
}
|
||||
|
||||
var data_2 = {
|
||||
"title":{
|
||||
"text": "Many data lines",
|
||||
"style": "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"
|
||||
},
|
||||
|
||||
"y_legend":{
|
||||
"text": "Open Flash Chart",
|
||||
"style": "{color: #736AFF; font-size: 12px;}"
|
||||
},
|
||||
|
||||
"elements":[
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#9933CC",
|
||||
"text": "Page views",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,7]
|
||||
},
|
||||
{
|
||||
"type": "bar",
|
||||
"alpha": 0.5,
|
||||
"colour": "#CC9933",
|
||||
"text": "Page views 2",
|
||||
"font-size": 10,
|
||||
"values" : [9,6,7,9,5,7,6,9,7]
|
||||
}
|
||||
],
|
||||
|
||||
"x_axis":{
|
||||
"stroke":1,
|
||||
"tick_height":10,
|
||||
"colour":"#d000d0",
|
||||
"grid_colour":"#00ff00",
|
||||
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
|
||||
},
|
||||
|
||||
"y_axis":{
|
||||
"stroke": 4,
|
||||
"tick_length": 3,
|
||||
"colour": "#d000d0",
|
||||
"grid_colour": "#00ff00",
|
||||
"offset": 0,
|
||||
"max": 20
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div id="my_chart"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var so = new SWFObject("../open-flash-chart/open-flash-chart.swf?p=moo", "ofc", "300", "250", "9", "#FFFFFF");
|
||||
so.addParam("allowScriptAccess", "always" );//"sameDomain");
|
||||
so.write("my_chart");
|
||||
</script>
|
||||
|
||||
<a href="javascript:load()">load json</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class AnimationBase
|
||||
{
|
||||
|
||||
}
|
||||
public class Animation : AnimationBase
|
||||
{
|
||||
private string type;
|
||||
private double? cascade;
|
||||
private double? delay;
|
||||
public Animation()
|
||||
{}
|
||||
public Animation(string type,int? cascade,double? delay)
|
||||
{
|
||||
this.Type = type;
|
||||
this.Cascade = cascade;
|
||||
this.Delay = delay;
|
||||
}
|
||||
[JsonProperty("type")]
|
||||
public string Type
|
||||
{
|
||||
get { return type; }
|
||||
set { type = value; }
|
||||
}
|
||||
[JsonProperty("cascade")]
|
||||
public double? Cascade
|
||||
{
|
||||
get { return cascade; }
|
||||
set { cascade = value; }
|
||||
}
|
||||
[JsonProperty("delay")]
|
||||
public double? Delay
|
||||
{
|
||||
get { return delay; }
|
||||
set { delay = value; }
|
||||
}
|
||||
}
|
||||
public class PieAnimation : AnimationBase
|
||||
{
|
||||
private string type;
|
||||
private int? distance;
|
||||
/// <summary>
|
||||
/// used in pie animation
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="distance"></param>
|
||||
public PieAnimation(string type,int?distance)
|
||||
{
|
||||
this.type = type;
|
||||
this.distance = distance;
|
||||
}
|
||||
[JsonProperty("type")]
|
||||
public string Type
|
||||
{
|
||||
get { return type; }
|
||||
set { type = value; }
|
||||
}
|
||||
[JsonProperty("distance")]
|
||||
public int? Distance
|
||||
{
|
||||
get { return distance; }
|
||||
set { distance = value; }
|
||||
}
|
||||
}
|
||||
public class PieAnimationSeries:List<PieAnimation>
|
||||
{}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class AnimationType
|
||||
{
|
||||
public const string Popup = "pop-up";
|
||||
public const string Explode = "explode";
|
||||
public const string MidSlide = "mid-slide";
|
||||
public const string Drop = "drop";
|
||||
public const string Fadein = "fade-in";
|
||||
public const string Shrinkin = "shrink-in";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Area:AreaBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public abstract class AreaBase:Chart<double >
|
||||
{
|
||||
private int? width;
|
||||
private double? dotsize;
|
||||
private double? halosize;
|
||||
private bool loop;
|
||||
private string fillcolour;
|
||||
private Animation onshow = new Animation();
|
||||
protected AreaBase()
|
||||
{
|
||||
this.ChartType = "area";
|
||||
}
|
||||
[JsonProperty("fill")]
|
||||
public string FillColor
|
||||
{
|
||||
get { return fillcolour; }
|
||||
set { fillcolour = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("width")]
|
||||
public virtual int? Width
|
||||
{
|
||||
set { this.width = value; }
|
||||
get { return this.width; }
|
||||
}
|
||||
|
||||
[JsonProperty("dot-size")]
|
||||
public virtual double? DotSize
|
||||
{
|
||||
get { return dotsize; }
|
||||
set { dotsize = value; }
|
||||
}
|
||||
[JsonProperty("loop")]
|
||||
public bool Loop
|
||||
{
|
||||
get { return loop; }
|
||||
set { loop = value; }
|
||||
}
|
||||
[JsonProperty("halo-size")]
|
||||
public double? HaloSize
|
||||
{
|
||||
get { return halosize; }
|
||||
set { halosize = value; }
|
||||
}
|
||||
[JsonProperty("on-show")]
|
||||
public Animation OnShowAnimation
|
||||
{
|
||||
get { return onshow; }
|
||||
set { onshow = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
[Obsolete("use Area instead")]
|
||||
public class AreaHollow : AreaBase
|
||||
{
|
||||
|
||||
public AreaHollow()
|
||||
{
|
||||
//this.ChartType = "area_hollow";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
[Obsolete("use Area instead")]
|
||||
public class AreaLine:AreaBase
|
||||
{
|
||||
public AreaLine()
|
||||
{
|
||||
// this.ChartType = "area_line";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Axis
|
||||
{
|
||||
private int? stroke;
|
||||
private string colour;
|
||||
private string gridColour;
|
||||
|
||||
|
||||
private int? steps;
|
||||
private int _3D;
|
||||
|
||||
private double? min;
|
||||
private double? max;
|
||||
private bool offset;
|
||||
public Axis()
|
||||
{
|
||||
offset = true;
|
||||
}
|
||||
[JsonProperty("stroke")]
|
||||
public int? Stroke
|
||||
{
|
||||
set { this.stroke = value; }
|
||||
get { return this.stroke; }
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Colour
|
||||
{
|
||||
set { this.colour = value; }
|
||||
get { return this.colour; }
|
||||
}
|
||||
[JsonProperty("grid-colour")]
|
||||
public string GridColour
|
||||
{
|
||||
set { this.gridColour = value; }
|
||||
get { return this.gridColour; }
|
||||
}
|
||||
[JsonProperty("steps")]
|
||||
public int? Steps
|
||||
{
|
||||
set { steps = value; }
|
||||
get { return this.steps; }
|
||||
}
|
||||
|
||||
|
||||
public void SetColors(string color,string gridcolor)
|
||||
{
|
||||
this.colour = color;
|
||||
this.gridColour = gridcolor;
|
||||
}
|
||||
public void Set3D(int width)
|
||||
{
|
||||
this.Axis3D = width;
|
||||
}
|
||||
|
||||
[JsonProperty("min")]
|
||||
public double? Min
|
||||
{
|
||||
get { return min; }
|
||||
set { this.min = value; }
|
||||
}
|
||||
[JsonProperty("max")]
|
||||
public double? Max
|
||||
{
|
||||
get { return max; }
|
||||
set { this.max = value; }
|
||||
}
|
||||
[JsonProperty("3d")]
|
||||
public int Axis3D
|
||||
{
|
||||
get { return _3D; }
|
||||
set { _3D = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("offset")]
|
||||
public bool Offset
|
||||
{
|
||||
set { offset = value; }
|
||||
get { return offset; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetRange(double? min, double? max)
|
||||
{
|
||||
Max = max;
|
||||
Min = min;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class AxisLabel
|
||||
{
|
||||
private string colour;
|
||||
private string text;
|
||||
private int size;
|
||||
private string rotate;
|
||||
private bool visible = true;
|
||||
public AxisLabel()
|
||||
{
|
||||
this.visible = true;
|
||||
size = 12;
|
||||
}
|
||||
public AxisLabel(string text)
|
||||
{
|
||||
this.text = text;
|
||||
this.visible = true;
|
||||
size = 12;
|
||||
}
|
||||
public static implicit operator AxisLabel(string text)
|
||||
{
|
||||
return new AxisLabel(text);
|
||||
}
|
||||
public AxisLabel(string text, string colour, int size, string rotate)
|
||||
{
|
||||
this.text = text;
|
||||
this.colour = colour;
|
||||
this.size = size;
|
||||
this.rotate = rotate;
|
||||
|
||||
this.visible = true;
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Color
|
||||
{
|
||||
set { this.colour = value; }
|
||||
get { return this.colour; }
|
||||
}
|
||||
[JsonProperty("text")]
|
||||
public string Text
|
||||
{
|
||||
set { this.text = value; }
|
||||
get { return this.text; }
|
||||
}
|
||||
[JsonProperty("size")]
|
||||
public int Size
|
||||
{
|
||||
set { this.size = value; }
|
||||
get { return this.size; }
|
||||
}
|
||||
[JsonProperty("rotate")]
|
||||
public string Rotate
|
||||
{
|
||||
set { this.rotate = value; }
|
||||
get { return this.rotate; }
|
||||
}
|
||||
[JsonIgnore]
|
||||
public bool Vertical
|
||||
{
|
||||
set {
|
||||
if(value)
|
||||
this.rotate = "vertical";
|
||||
}
|
||||
}
|
||||
[JsonProperty("visible")]
|
||||
public bool Visible
|
||||
{
|
||||
set { this.visible = value; }
|
||||
get { return this.visible; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class AxisLabels
|
||||
{
|
||||
private int? steps;
|
||||
protected IList<object> labels;
|
||||
private string colour;
|
||||
private string rotate;
|
||||
private int? fontsize;
|
||||
private int? visiblesteps;
|
||||
|
||||
private string formatstring;
|
||||
|
||||
[JsonProperty("steps")]
|
||||
public int? Steps
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.steps == null)
|
||||
return null;
|
||||
return this.steps;
|
||||
}
|
||||
set { this.steps = value; }
|
||||
}
|
||||
[JsonProperty("labels")]
|
||||
[Obsolete("just for json generation,not used.Use SetLabels()")]
|
||||
public IList<object> AxisLabelValues
|
||||
{
|
||||
get { return labels; }
|
||||
set { this.labels = value; }
|
||||
}
|
||||
public virtual void SetLabels(IList<string> labelsvalue)
|
||||
{
|
||||
if (labels == null)
|
||||
labels = new List<object>();
|
||||
foreach (string s in labelsvalue)
|
||||
{
|
||||
labels.Add(s);
|
||||
}
|
||||
}
|
||||
public void Add(AxisLabel label)
|
||||
{
|
||||
if (labels == null)
|
||||
labels = new List<object>();
|
||||
labels.Add(label);
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Color
|
||||
{
|
||||
set { this.colour = value; }
|
||||
get { return this.colour; }
|
||||
}
|
||||
[JsonProperty("rotate")]
|
||||
public string Rotate
|
||||
{
|
||||
set { this.rotate = value; }
|
||||
get { return this.rotate; }
|
||||
}
|
||||
[JsonIgnore]
|
||||
public bool Vertical
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
this.rotate = "vertical";
|
||||
}
|
||||
}
|
||||
[JsonProperty("size")]
|
||||
public int? FontSize
|
||||
{
|
||||
get { return fontsize; }
|
||||
set { fontsize = value; }
|
||||
}
|
||||
[JsonProperty("text")]
|
||||
public string FormatString
|
||||
{
|
||||
get { return formatstring; }
|
||||
set { formatstring = value; }
|
||||
}
|
||||
[JsonProperty("visible-steps")]
|
||||
public int? VisibleSteps
|
||||
{
|
||||
get { return visiblesteps; }
|
||||
set { visiblesteps = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class BarValue
|
||||
{
|
||||
protected double? bottom;
|
||||
protected double? top;
|
||||
protected string color;
|
||||
protected string tip;
|
||||
private string onclick;
|
||||
public BarValue()
|
||||
{
|
||||
|
||||
}
|
||||
public BarValue(double top)
|
||||
{
|
||||
this.top = top;
|
||||
}
|
||||
public BarValue(double top,double bottom)
|
||||
{
|
||||
this.bottom = bottom;
|
||||
this.top = top;
|
||||
}
|
||||
[JsonProperty("bottom")]
|
||||
public double? Bottom
|
||||
{
|
||||
get { return bottom; }
|
||||
set { bottom = value; }
|
||||
}
|
||||
[JsonProperty("top")]
|
||||
public double? Top
|
||||
{
|
||||
get { return top; }
|
||||
set { top = value; }
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Color
|
||||
{
|
||||
get { return color; }
|
||||
set { color = value; }
|
||||
}
|
||||
[JsonProperty("tip")]
|
||||
public string Tip
|
||||
{
|
||||
get { return tip; }
|
||||
set { tip = value; }
|
||||
}
|
||||
[JsonProperty("on-click")]
|
||||
public string OnClick
|
||||
{
|
||||
get { return onclick; }
|
||||
set { onclick = value; }
|
||||
}
|
||||
}
|
||||
public class Bar:BarBase
|
||||
{
|
||||
public Bar()
|
||||
{
|
||||
this.ChartType = "bar";
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string BarType
|
||||
{
|
||||
get { return this.ChartType; }
|
||||
set { this.ChartType = value; }
|
||||
}
|
||||
|
||||
public void Add(BarValue barValue)
|
||||
{
|
||||
this.Values.Add(barValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Bar3D:BarBase
|
||||
{
|
||||
|
||||
public Bar3D()
|
||||
{
|
||||
this.ChartType = "bar_3d";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public abstract class BarBase : Chart<double>
|
||||
{
|
||||
private Animation onshow = new Animation();
|
||||
protected BarBase()
|
||||
{
|
||||
this.ChartType = "bar";
|
||||
}
|
||||
[JsonProperty("on-show")]
|
||||
public Animation OnShowAnimation
|
||||
{
|
||||
get { return onshow; }
|
||||
set { onshow = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class BarFilledValue:BarValue
|
||||
{
|
||||
private string outline_color;
|
||||
public BarFilledValue():base()
|
||||
{}
|
||||
public BarFilledValue(double top, double bottom):base(top,bottom)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
[JsonProperty("outline-colour")]
|
||||
public string OutlineColor
|
||||
{
|
||||
get { return outline_color; }
|
||||
set { outline_color = value; }
|
||||
}
|
||||
}
|
||||
public class BarFilled : BarBase
|
||||
{
|
||||
public BarFilled()
|
||||
{
|
||||
this.ChartType = "bar_filled";
|
||||
}
|
||||
public void Add(BarFilledValue barFilledValue)
|
||||
{
|
||||
this.Values.Add(barFilledValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class BarGlassValue:BarValue
|
||||
{
|
||||
public BarGlassValue(double top):base(top)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public class BarGlass : BarBase
|
||||
{
|
||||
public BarGlass()
|
||||
{
|
||||
this.ChartType = "bar_glass";
|
||||
}
|
||||
public void Add(BarGlassValue barGlassValue)
|
||||
{
|
||||
this.Values.Add(barGlassValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class BarSketch:BarBase
|
||||
{
|
||||
private string outlinecolour;
|
||||
private int? offset;
|
||||
public BarSketch(string colour,string outlinecolor,int? offset)
|
||||
{
|
||||
this.ChartType = "bar_sketch";
|
||||
this.Colour = colour;
|
||||
this.outlinecolour = outlinecolor;
|
||||
this.offset = offset;
|
||||
}
|
||||
[JsonProperty("offset")]
|
||||
public int? Offset
|
||||
{
|
||||
get { return offset.Value; }
|
||||
set { this.offset = value; }
|
||||
}
|
||||
[JsonProperty("outline-colour")]
|
||||
public string OutlineColour
|
||||
{
|
||||
get { return outlinecolour; }
|
||||
set { this.outlinecolour = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class BarStackValue
|
||||
{
|
||||
private string colour;
|
||||
private double val;
|
||||
public BarStackValue(double val,string color)
|
||||
{
|
||||
this.Colour = color;
|
||||
this.Val = val;
|
||||
}
|
||||
public BarStackValue(double val)
|
||||
{
|
||||
this.Val = val;
|
||||
}
|
||||
public BarStackValue()
|
||||
{
|
||||
|
||||
}
|
||||
public static implicit operator BarStackValue(double val)
|
||||
{
|
||||
return new BarStackValue(val);
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Colour
|
||||
{
|
||||
get { return colour; }
|
||||
set { colour = value; }
|
||||
}
|
||||
[JsonProperty("val")]
|
||||
public double Val
|
||||
{
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
}
|
||||
public class BarStack:BarBase
|
||||
{
|
||||
public BarStack()
|
||||
{
|
||||
this.ChartType = "bar_stack";
|
||||
}
|
||||
public void Add(BarStackValue barStackValue)
|
||||
{
|
||||
this.Values.Add(barStackValue);
|
||||
}
|
||||
public void AddStack(List<BarStackValue> barStackValues)
|
||||
{
|
||||
base.Values.Add(barStackValues);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public static class BarType
|
||||
{
|
||||
public const string BAR = "bar";
|
||||
public const string HBAR = "hbar";
|
||||
public const string BAR_STACK = "bar_stack";
|
||||
public const string BAR_SKETCH = "bar_sketch";
|
||||
public const string BAR_GLASS = "bar_glass";
|
||||
|
||||
public const string BAR_CYLINDER = "bar_cylinder";
|
||||
public const string BAR_CYLINDER_OUTLINE = "bar_cylinder_outline";
|
||||
public const string BAR_DOME = "bar_dome";
|
||||
public const string BAR_ROUND = "bar_round";
|
||||
public const string BAR_ROUND_GLASS = "bar_round_glass";
|
||||
public const string BAR_ROUND3D = "bar_round3d";
|
||||
|
||||
public const string BAR_FADE = "bar_fade";
|
||||
public const string BAR_3D = "bar_3d";
|
||||
public const string BAR_FILLED = "bar_filled";
|
||||
public const string BAR_PLASTIC = "bar_plastic";
|
||||
public const string BAR_PLASTIC_FLAT = "bar_plastic_flat";
|
||||
|
||||
public const string CANDLE = "candle";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class CandleValue:BarValue
|
||||
{
|
||||
protected double? high;
|
||||
protected double? low;
|
||||
|
||||
[JsonProperty("high")]
|
||||
public double? High
|
||||
{
|
||||
get { return high; }
|
||||
set { high = value; }
|
||||
}
|
||||
[JsonProperty("low")]
|
||||
public double? Low
|
||||
{
|
||||
get { return low; }
|
||||
set { low = value; }
|
||||
}
|
||||
public CandleValue()
|
||||
{}
|
||||
public CandleValue(double high,double top,double bottom,double low)
|
||||
{
|
||||
this.high = high;
|
||||
this.top = top;
|
||||
this.bottom = bottom;
|
||||
this.low = low;
|
||||
}
|
||||
}
|
||||
public class Candle:BarBase
|
||||
{
|
||||
public Candle()
|
||||
{
|
||||
this.ChartType = "candle";
|
||||
}
|
||||
public void Add(CandleValue candleValue)
|
||||
{
|
||||
this.values.Add(candleValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Chart<T> :ChartBase
|
||||
{
|
||||
public Chart()
|
||||
{
|
||||
this.values = new ArrayList();
|
||||
FillAlpha = 0.35;
|
||||
//fontsize = 20;
|
||||
}
|
||||
|
||||
//public override double GetMaxValue()
|
||||
//{
|
||||
// if (values.Count == 0)
|
||||
// return 0;
|
||||
// double max = double.MinValue;
|
||||
// Type valuetype = typeof(T);
|
||||
// if (!valuetype.IsValueType)
|
||||
// return 0;
|
||||
// foreach (T d in values)
|
||||
// {
|
||||
// double temp = double.Parse(d.ToString());
|
||||
// if (temp > max)
|
||||
// max = temp;
|
||||
// }
|
||||
// return max;
|
||||
//}
|
||||
|
||||
//public override double GetMinValue()
|
||||
//{
|
||||
// if (values.Count == 0)
|
||||
// return 0;
|
||||
// double min = double.MaxValue;
|
||||
// Type valuetype = typeof (T);
|
||||
// if (!valuetype.IsValueType)
|
||||
// return 0;
|
||||
// foreach (T d in values)
|
||||
// {
|
||||
// double temp = double.Parse(d.ToString());
|
||||
// if(temp<min)
|
||||
// min = temp;
|
||||
// }
|
||||
// return min;
|
||||
//}
|
||||
public void Add(T v)
|
||||
{
|
||||
this.values.Add(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public abstract class ChartBase
|
||||
{
|
||||
private string type;
|
||||
protected IList values;
|
||||
private double fillalpha;
|
||||
private double? alpha;
|
||||
private double? fontsize;
|
||||
private string colour;
|
||||
private string text;
|
||||
private string tooltip;
|
||||
private DotStyle dotstyle;
|
||||
private bool attachtorightaxis;
|
||||
protected ChartBase()
|
||||
{
|
||||
this.values = new ArrayList();
|
||||
FillAlpha = 0.35;
|
||||
colour = "#CC3399";
|
||||
attachtorightaxis = false;
|
||||
}
|
||||
public void AttachToRightAxis(bool attach)
|
||||
{
|
||||
attachtorightaxis = attach;
|
||||
}
|
||||
[JsonProperty("axis")]
|
||||
[Description("use AttachToRight(),this property only for json generate.")]
|
||||
public string AttachedAxis
|
||||
{
|
||||
get
|
||||
{
|
||||
if (attachtorightaxis)
|
||||
return "right";
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
attachtorightaxis = string.Compare(value,"right",StringComparison.CurrentCultureIgnoreCase)==0;
|
||||
}
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Colour
|
||||
{
|
||||
set { this.colour = value; }
|
||||
get { return this.colour; }
|
||||
}
|
||||
public virtual int GetValueCount()
|
||||
{
|
||||
return values.Count;
|
||||
}
|
||||
[JsonProperty("tip")]
|
||||
public virtual string Tooltip
|
||||
{
|
||||
set { this.tooltip = value; }
|
||||
get { return this.tooltip; }
|
||||
}
|
||||
|
||||
[JsonProperty("values")]
|
||||
public virtual IList Values
|
||||
{
|
||||
set
|
||||
{
|
||||
// foreach (T t in value)
|
||||
// {
|
||||
// this.values.Add(t);
|
||||
// }
|
||||
this.values = value;
|
||||
}
|
||||
get { return this.values; }
|
||||
}
|
||||
|
||||
[JsonProperty("font-size")]
|
||||
[System.ComponentModel.DefaultValue(12.0)]
|
||||
public double? FontSize
|
||||
{
|
||||
get { return fontsize; }
|
||||
set { fontsize = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("text")]
|
||||
public string Text
|
||||
{
|
||||
get { return text; }
|
||||
set { text = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("fill-alpha")]
|
||||
public double FillAlpha
|
||||
{
|
||||
get { return fillalpha; }
|
||||
set { fillalpha = value; }
|
||||
}
|
||||
[JsonProperty("alpha")]
|
||||
public double? Alpha
|
||||
{
|
||||
get { return alpha; }
|
||||
set { alpha = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string ChartType
|
||||
{
|
||||
get { return type; }
|
||||
set { type = value; }
|
||||
}
|
||||
[JsonProperty("dot-style")]
|
||||
public DotStyle DotStyleType
|
||||
{
|
||||
get
|
||||
{
|
||||
if(dotstyle==null)
|
||||
dotstyle=new DotStyle();
|
||||
return dotstyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(dotstyle==null)
|
||||
dotstyle=new DotStyle();
|
||||
dotstyle = value;
|
||||
}
|
||||
}
|
||||
|
||||
//public abstract Double GetMinValue();
|
||||
//public abstract Double GetMaxValue();
|
||||
|
||||
public void Set_Key(string key, double font_size)
|
||||
{
|
||||
this.Text = key;
|
||||
FontSize = font_size;
|
||||
}
|
||||
public void Add(object v)
|
||||
{
|
||||
this.values.Add(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using System.Web.UI.Design;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class ChartControlDesigner : ControlDesigner
|
||||
{
|
||||
public override string GetDesignTimeHtml()
|
||||
{
|
||||
string errorDesignTimeHtml;
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try
|
||||
{
|
||||
OpenFlashChartControl component = (OpenFlashChartControl)base.Component;
|
||||
OpenFlashChartControl chart = component;
|
||||
builder.AppendFormat("<div style='width:{0};height:{1};'>", chart.Width, chart.Height);
|
||||
builder.Append("<span style=\"font-size:16px;position:absolute;\">Open Flash Chart Control</span>");
|
||||
|
||||
builder.Append("</div>");
|
||||
errorDesignTimeHtml = this.CreatePlaceHolderDesignTimeHtml(builder.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errorDesignTimeHtml = this.GetErrorDesignTimeHtml(e);
|
||||
}
|
||||
return errorDesignTimeHtml;
|
||||
}
|
||||
|
||||
protected override string GetErrorDesignTimeHtml(Exception e)
|
||||
{
|
||||
string instruction = string.Format("Exception:{0}", e.Message );
|
||||
return this.CreatePlaceHolderDesignTimeHtml(instruction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class ChartElement
|
||||
{
|
||||
private string text;
|
||||
private string style;
|
||||
[JsonProperty("text")]
|
||||
public virtual string Text
|
||||
{
|
||||
set { this.text = value; }
|
||||
get { return this.text; }
|
||||
}
|
||||
[JsonProperty("style")]
|
||||
public string Style
|
||||
{
|
||||
set { style = value; }
|
||||
get
|
||||
{
|
||||
if (style == null)
|
||||
style = "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}";
|
||||
return this.style;
|
||||
}
|
||||
//"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class DotStyle
|
||||
{
|
||||
private string type;
|
||||
private int? sides;
|
||||
private double? alpha;
|
||||
private bool? isHollow;
|
||||
private string background_colour;
|
||||
private double ? background_alpha;
|
||||
private int? width;
|
||||
private string tip;
|
||||
private string colour;
|
||||
private int? dotsize;
|
||||
private string onclick;
|
||||
private Animation onshow = new Animation();
|
||||
[JsonProperty("on-show")]
|
||||
public Animation OnShowAnimation
|
||||
{
|
||||
get { return onshow; }
|
||||
set { onshow = value; }
|
||||
}
|
||||
[JsonProperty("type")]
|
||||
public String Type
|
||||
{
|
||||
get{ return type;}
|
||||
set { type = value; }
|
||||
}
|
||||
[JsonProperty("sides")]
|
||||
public int? Sides
|
||||
{
|
||||
get { return sides; }
|
||||
set { sides = value; }
|
||||
}
|
||||
[JsonProperty("alpha")]
|
||||
public double? Alpha
|
||||
{
|
||||
get { return alpha; }
|
||||
set { alpha = value; }
|
||||
}
|
||||
[JsonProperty("hollow")]
|
||||
public bool? IsHollow
|
||||
{
|
||||
get { return isHollow; }
|
||||
set { isHollow = value; }
|
||||
}
|
||||
[JsonProperty("background-colour")]
|
||||
public string BackgroundColour
|
||||
{
|
||||
get { return background_colour; }
|
||||
set { background_colour = value; }
|
||||
}
|
||||
[JsonProperty("background-alpha")]
|
||||
public double? BackgroundAlpha
|
||||
{
|
||||
get { return background_alpha; }
|
||||
set { background_alpha = value; }
|
||||
}
|
||||
[JsonProperty("width")]
|
||||
public int? Width
|
||||
{
|
||||
get { return width; }
|
||||
set { width = value; }
|
||||
}
|
||||
[JsonProperty("tip")]
|
||||
public string Tip
|
||||
{
|
||||
get { return tip; }
|
||||
set { tip = value; }
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Colour
|
||||
{
|
||||
get { return colour; }
|
||||
set { colour = value; }
|
||||
}
|
||||
[JsonProperty("dot-size")]
|
||||
public int? DotSize
|
||||
{
|
||||
get { return dotsize; }
|
||||
set { dotsize = value; }
|
||||
}
|
||||
[JsonProperty("on-click")]
|
||||
public string OnClick
|
||||
{
|
||||
get { return onclick; }
|
||||
set { onclick = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
//trick ,use class as enum.
|
||||
public static class DotType
|
||||
{
|
||||
public const string SOLID_DOT = "solid-dot";
|
||||
public const string HOLLOW_DOT = "hollow-dot";
|
||||
public const string ANCHOR = "anchor";
|
||||
public const string STAR = "star";
|
||||
public const string BOW = "bow";
|
||||
public const string DOT = "dot";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class HBarValue
|
||||
{
|
||||
private double left;
|
||||
private double right;
|
||||
private string tip;
|
||||
public HBarValue(double left,double right)
|
||||
{
|
||||
this.Left = left;
|
||||
this.Right = right;
|
||||
}
|
||||
public HBarValue(double left, double right,string tip)
|
||||
{
|
||||
this.Left = left;
|
||||
this.Right = right;
|
||||
this.tip = tip;
|
||||
}
|
||||
[JsonProperty("left")]
|
||||
public double Left
|
||||
{
|
||||
get { return left; }
|
||||
set { left = value; }
|
||||
}
|
||||
[JsonProperty("right")]
|
||||
public double Right
|
||||
{
|
||||
get { return right; }
|
||||
set { right = value; }
|
||||
}
|
||||
|
||||
public string Tip
|
||||
{
|
||||
get { return tip; }
|
||||
set { tip = value; }
|
||||
}
|
||||
}
|
||||
public class HBar:BarBase
|
||||
{
|
||||
public HBar()
|
||||
{
|
||||
this.ChartType = "hbar";
|
||||
}
|
||||
public void Add(HBarValue hBarValue)
|
||||
{
|
||||
this.Values.Add(hBarValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows classes to control their own JSON serialization
|
||||
/// </summary>
|
||||
public interface IJsonSerializable
|
||||
{
|
||||
void ReadJson(JsonReader reader);
|
||||
void WriteJson(JsonWriter writer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
/// <summary>
|
||||
/// Designates a property or field to not be serialized.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple=false)]
|
||||
public sealed class JsonIgnoreAttribute : Attribute
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value which indicates if should be ignored in Json serialization.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsJsonIgnore(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Type type = value.GetType();
|
||||
|
||||
ICustomAttributeProvider provider = null;
|
||||
if (type.IsEnum)
|
||||
{
|
||||
provider = type.GetField(Enum.GetName(type, value));
|
||||
}
|
||||
else
|
||||
{
|
||||
provider = value as ICustomAttributeProvider;
|
||||
}
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
return provider.IsDefined(typeof(JsonIgnoreAttribute), true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value which indicates if should be ignored in Json serialization.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsXmlIgnore(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Type type = value.GetType();
|
||||
|
||||
ICustomAttributeProvider provider = null;
|
||||
if (type.IsEnum)
|
||||
{
|
||||
provider = type.GetField(Enum.GetName(type, value));
|
||||
}
|
||||
else
|
||||
{
|
||||
provider = value as ICustomAttributeProvider;
|
||||
}
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
return provider.IsDefined(typeof(XmlIgnoreAttribute), true);
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the naming to use for a property or field when serializing
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple=false)]
|
||||
public class JsonNameAttribute : Attribute
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private string jsonName = null;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Init
|
||||
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
public JsonNameAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
/// <param name="jsonName"></param>
|
||||
public JsonNameAttribute(string jsonName)
|
||||
{
|
||||
this.jsonName = JsonWriter.EnsureValidIdentifier(jsonName, false);
|
||||
}
|
||||
|
||||
#endregion Init
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the name to be used in JSON
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get { return this.jsonName; }
|
||||
set { this.jsonName = JsonWriter.EnsureValidIdentifier(value, false); }
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name specified for use in Json serialization.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetJsonName(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Type type = value.GetType();
|
||||
MemberInfo memberInfo = null;
|
||||
|
||||
if (type.IsEnum)
|
||||
{
|
||||
string name = Enum.GetName(type, value);
|
||||
if (String.IsNullOrEmpty(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
memberInfo = type.GetField(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
memberInfo = value as MemberInfo;
|
||||
}
|
||||
|
||||
if (memberInfo == null)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
if (!Attribute.IsDefined(memberInfo, typeof(JsonNameAttribute)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
JsonNameAttribute attribute = (JsonNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(JsonNameAttribute));
|
||||
|
||||
return attribute.Name;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Gets the name specified for use in Json serialization.
|
||||
///// </summary>
|
||||
///// <param name="value"></param>
|
||||
///// <returns></returns>
|
||||
//public static string GetXmlName(object value)
|
||||
//{
|
||||
// if (value == null)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// Type type = value.GetType();
|
||||
// ICustomAttributeProvider memberInfo = null;
|
||||
|
||||
// if (type.IsEnum)
|
||||
// {
|
||||
// string name = Enum.GetName(type, value);
|
||||
// if (String.IsNullOrEmpty(name))
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// memberInfo = type.GetField(name);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// memberInfo = value as ICustomAttributeProvider;
|
||||
// }
|
||||
|
||||
// if (memberInfo == null)
|
||||
// {
|
||||
// throw new ArgumentException();
|
||||
// }
|
||||
|
||||
// XmlAttributes xmlAttributes = new XmlAttributes(memberInfo);
|
||||
// if (xmlAttributes.XmlElements.Count == 1 &&
|
||||
// !String.IsNullOrEmpty(xmlAttributes.XmlElements[0].ElementName))
|
||||
// {
|
||||
// return xmlAttributes.XmlElements[0].ElementName;
|
||||
// }
|
||||
// if (xmlAttributes.XmlAttribute != null &&
|
||||
// !String.IsNullOrEmpty(xmlAttributes.XmlAttribute.AttributeName))
|
||||
// {
|
||||
// return xmlAttributes.XmlAttribute.AttributeName;
|
||||
// }
|
||||
|
||||
// return null;
|
||||
//}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple=false)]
|
||||
public class JsonPropertyAttribute:JsonNameAttribute
|
||||
{
|
||||
public JsonPropertyAttribute():base()
|
||||
{ }
|
||||
public JsonPropertyAttribute(string jsonname):base(jsonname)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,153 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
public class JsonSerializationException : InvalidOperationException
|
||||
{
|
||||
#region Init
|
||||
|
||||
public JsonSerializationException() : base() { }
|
||||
|
||||
public JsonSerializationException(string message) : base(message) { }
|
||||
|
||||
public JsonSerializationException(string message, Exception innerException) : base(message, innerException) { }
|
||||
|
||||
public JsonSerializationException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Init
|
||||
}
|
||||
|
||||
public class JsonDeserializationException : JsonSerializationException
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private int index = -1;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Init
|
||||
|
||||
public JsonDeserializationException(string message, int index) : base(message)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public JsonDeserializationException(string message, Exception innerException, int index)
|
||||
: base(message, innerException)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public JsonDeserializationException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Init
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the character position in the stream where the error occurred.
|
||||
/// </summary>
|
||||
public int Index
|
||||
{
|
||||
get { return this.index; }
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Helper method which converts the index into Line and Column numbers
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="line"></param>
|
||||
/// <param name="col"></param>
|
||||
public void GetLineAndColumn(string source, out int line, out int col)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
col = 1;
|
||||
line = 1;
|
||||
|
||||
bool foundLF = false;
|
||||
int i = Math.Min(this.index, source.Length);
|
||||
for (; i>0; i--)
|
||||
{
|
||||
if (!foundLF)
|
||||
{
|
||||
col++;
|
||||
}
|
||||
if (source[i-1] == '\n')
|
||||
{
|
||||
line++;
|
||||
foundLF = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
|
||||
public class JsonTypeCoersionException : ArgumentException
|
||||
{
|
||||
#region Init
|
||||
|
||||
public JsonTypeCoersionException() : base() { }
|
||||
|
||||
public JsonTypeCoersionException(string message) : base(message) { }
|
||||
|
||||
public JsonTypeCoersionException(string message, Exception innerException) : base(message, innerException) { }
|
||||
|
||||
public JsonTypeCoersionException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Init
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the name of the property which specifies if member should be serialized.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=false)]
|
||||
public class JsonSpecifiedPropertyAttribute : Attribute
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private string specifiedProperty = null;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Init
|
||||
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
/// <param name="propertyName">the name of the property which controls serialization for this member</param>
|
||||
public JsonSpecifiedPropertyAttribute(string propertyName)
|
||||
{
|
||||
this.specifiedProperty = propertyName;
|
||||
}
|
||||
|
||||
#endregion Init
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the name of the property which
|
||||
/// specifies if member should be serialized
|
||||
/// </summary>
|
||||
public string SpecifiedProperty
|
||||
{
|
||||
get { return this.specifiedProperty; }
|
||||
set { this.specifiedProperty = value; }
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name specified for use in Json serialization.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetJsonSpecifiedProperty(MemberInfo memberInfo)
|
||||
{
|
||||
if (memberInfo == null ||
|
||||
!Attribute.IsDefined(memberInfo, typeof(JsonSpecifiedPropertyAttribute)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
JsonSpecifiedPropertyAttribute attribute = (JsonSpecifiedPropertyAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(JsonSpecifiedPropertyAttribute));
|
||||
return attribute.SpecifiedProperty;
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#region License
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
|
||||
Distributed under the terms of an MIT-style license:
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006-2009 Stephen M. McKamey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
#endregion License
|
||||
|
||||
using System;
|
||||
|
||||
namespace JsonFx.Json
|
||||
{
|
||||
/// <summary>
|
||||
/// Parse Tokens
|
||||
/// </summary>
|
||||
internal enum JsonToken
|
||||
{
|
||||
End,
|
||||
Undefined,
|
||||
Null,
|
||||
False,
|
||||
True,
|
||||
NaN,
|
||||
PositiveInfinity,
|
||||
NegativeInfinity,
|
||||
Number,
|
||||
String,
|
||||
ArrayStart,
|
||||
ArrayEnd,
|
||||
ObjectStart,
|
||||
ObjectEnd,
|
||||
NameDelim,
|
||||
ValueDelim
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Legend:ChartElement
|
||||
{
|
||||
public Legend(string text)
|
||||
{
|
||||
base.Text = text;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Line : LineBase
|
||||
{
|
||||
public Line()
|
||||
{
|
||||
this.ChartType = "line";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
|
||||
public class LineBase : Chart<LineDotValue>
|
||||
{
|
||||
private int width;
|
||||
private int dotsize;
|
||||
private int halosize;
|
||||
private string onclick;
|
||||
private bool loop;
|
||||
private Animation onshow=new Animation();
|
||||
|
||||
public LineBase()
|
||||
{
|
||||
this.ChartType = "line";
|
||||
this.DotStyleType.Type = DotType.SOLID_DOT;
|
||||
|
||||
|
||||
}
|
||||
public void SetOnClickFunction(string func)
|
||||
{
|
||||
this.DotStyleType.OnClick = func;
|
||||
this.onclick = func;
|
||||
}
|
||||
public virtual string OnClick
|
||||
{
|
||||
set
|
||||
{
|
||||
SetOnClickFunction(value);
|
||||
}
|
||||
get { return this.onclick; }
|
||||
}
|
||||
[JsonProperty("width")]
|
||||
public virtual int Width
|
||||
{
|
||||
set { this.width = value; }
|
||||
get { return this.width; }
|
||||
}
|
||||
|
||||
[JsonProperty("dot-size")]
|
||||
public virtual int DotSize
|
||||
{
|
||||
get { return dotsize; }
|
||||
set { dotsize = value; }
|
||||
}
|
||||
[JsonProperty("halo-size")]
|
||||
public virtual int HaloSize
|
||||
{
|
||||
get { return halosize; }
|
||||
set { halosize = value; }
|
||||
}
|
||||
[JsonProperty("loop")]
|
||||
public bool Loop
|
||||
{
|
||||
get { return loop; }
|
||||
set { loop = value; }
|
||||
}
|
||||
[JsonProperty("on-show")]
|
||||
public Animation OnShowAnimation
|
||||
{
|
||||
get { return onshow; }
|
||||
set { onshow = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class LineDot:LineBase
|
||||
{
|
||||
public LineDot()
|
||||
{
|
||||
this.DotStyleType.Type = DotType.DOT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class LineDotValue
|
||||
{
|
||||
private double? val;
|
||||
private string tip;
|
||||
private string color;
|
||||
private int? sides;
|
||||
private int? rotation;
|
||||
private string type;
|
||||
private bool? isHollow;
|
||||
private int? dotsize;
|
||||
public LineDotValue()
|
||||
{ }
|
||||
public LineDotValue(double val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
public LineDotValue(double val, string tip, string color)
|
||||
{
|
||||
this.val = val;
|
||||
this.tip = tip;
|
||||
this.color = color;
|
||||
}
|
||||
public LineDotValue(double val, string color)
|
||||
{
|
||||
this.val = val;
|
||||
this.color = color;
|
||||
}
|
||||
[JsonProperty("value")]
|
||||
public double? Value
|
||||
{
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
[JsonProperty("tip")]
|
||||
public string Tip
|
||||
{
|
||||
get { return tip; }
|
||||
set { tip = value; }
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Color
|
||||
{
|
||||
get { return color; }
|
||||
set { color = value; }
|
||||
}
|
||||
[JsonProperty("sides")]
|
||||
public int? Sides
|
||||
{
|
||||
get { return sides; }
|
||||
set { sides = value; }
|
||||
}
|
||||
[JsonProperty("rotation")]
|
||||
public int? Rotation
|
||||
{
|
||||
get { return rotation; }
|
||||
set { rotation = value; }
|
||||
}
|
||||
[JsonProperty("type")]
|
||||
public string DotType
|
||||
{
|
||||
get { return type; }
|
||||
set { type = value; }
|
||||
}
|
||||
[JsonProperty("hollow")]
|
||||
public bool? IsHollow
|
||||
{
|
||||
get { return isHollow; }
|
||||
set { isHollow = value; }
|
||||
}
|
||||
[JsonProperty("dot-size")]
|
||||
public int? DotSize
|
||||
{
|
||||
get { return dotsize; }
|
||||
set { dotsize = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class LineHollow:LineBase
|
||||
{
|
||||
public LineHollow()
|
||||
{
|
||||
//this.ChartType = "line_hollow";
|
||||
this.DotStyleType.IsHollow = true;
|
||||
this.DotStyleType.Type = DotType.HOLLOW_DOT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class LineScatter:Scatter
|
||||
{
|
||||
public LineScatter()
|
||||
{
|
||||
this.ChartType = "scatter_line";
|
||||
this.DotStyleType.Type = DotType.SOLID_DOT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
using OpenFlashChart;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class OpenFlashChart
|
||||
{
|
||||
private Title title;
|
||||
private IList<ChartBase> elements;
|
||||
private XAxis x_axis;
|
||||
private YAxis y_axis;
|
||||
private YAxis y_axis_right;
|
||||
private Legend x_legend;
|
||||
private Legend y_legend;
|
||||
private Legend y2_legend;
|
||||
private string bgcolor;
|
||||
private RadarAxis radar_axis;
|
||||
private ToolTip tooltip;
|
||||
private int? num_decimals;
|
||||
private bool? is_fixed_num_decimals_forced;
|
||||
private bool? is_decimal_separator_comma;
|
||||
private bool? is_thousand_separator_disabled;
|
||||
|
||||
public OpenFlashChart()
|
||||
{
|
||||
title = new Title("Chart Title");
|
||||
Elements = new List<ChartBase>();
|
||||
//x_axis = new XAxis();
|
||||
//y_axis= new YAxis();
|
||||
//y_axis_right = new YAxis();
|
||||
}
|
||||
[JsonProperty("title")]
|
||||
public Title Title
|
||||
{
|
||||
set { this.title = value; }
|
||||
get { return this.title; }
|
||||
}
|
||||
[JsonProperty("x_axis")]
|
||||
public XAxis X_Axis
|
||||
{
|
||||
get
|
||||
{
|
||||
if(x_axis==null)
|
||||
x_axis= new XAxis();
|
||||
return this.x_axis;
|
||||
}
|
||||
set{ this.x_axis = value;}
|
||||
}
|
||||
[JsonProperty("y_axis")]
|
||||
public YAxis Y_Axis
|
||||
{
|
||||
get
|
||||
{
|
||||
if(y_axis==null)
|
||||
y_axis= new YAxis();
|
||||
return this.y_axis;
|
||||
}
|
||||
set { this.y_axis = value; }
|
||||
}
|
||||
[JsonProperty("y_axis_right")]
|
||||
public YAxis Y_Axis_Right
|
||||
{
|
||||
get
|
||||
{
|
||||
return y_axis_right;
|
||||
}
|
||||
set { y_axis_right = value; }
|
||||
}
|
||||
[JsonProperty("elements")]
|
||||
public IList<ChartBase> Elements
|
||||
{
|
||||
get { return elements; }
|
||||
set { elements = value; }
|
||||
}
|
||||
public void AddElement(ChartBase chart)
|
||||
{
|
||||
this.elements.Add(chart);
|
||||
//Y_Axis.SetRange(chart.GetMinValue(), chart.GetMaxValue());
|
||||
// X_Axis.SetRange(0,chart.GetValueCount());
|
||||
X_Axis.Steps = 1;
|
||||
}
|
||||
[JsonProperty("x_legend")]
|
||||
public Legend X_Legend
|
||||
{
|
||||
get { return x_legend; }
|
||||
set { x_legend = value; }
|
||||
}
|
||||
[JsonProperty("y_legend")]
|
||||
public Legend Y_Legend
|
||||
{
|
||||
get { return y_legend; }
|
||||
set { y_legend = value; }
|
||||
}
|
||||
[JsonProperty("y2_legend")]
|
||||
public Legend Y_RightLegend
|
||||
{
|
||||
get { return y2_legend; }
|
||||
set { y2_legend = value; }
|
||||
}
|
||||
[JsonProperty("bg_colour")]
|
||||
public string Bgcolor
|
||||
{
|
||||
get { return bgcolor; }
|
||||
set { bgcolor = value; }
|
||||
}
|
||||
[JsonProperty("tooltip")]
|
||||
public ToolTip Tooltip
|
||||
{
|
||||
get { return tooltip; }
|
||||
set { tooltip = value; }
|
||||
}
|
||||
[JsonProperty("radar_axis")]
|
||||
public RadarAxis Radar_Axis
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.radar_axis;
|
||||
}
|
||||
set { this.radar_axis = value; }
|
||||
}
|
||||
[JsonProperty("num_decimals")]
|
||||
public int? NumDecimals
|
||||
{
|
||||
get { return num_decimals; }
|
||||
set { num_decimals = value; }
|
||||
}
|
||||
[JsonProperty("is_fixed_num_decimals_forced")]
|
||||
public bool? IsFixedNumDecimalsForced
|
||||
{
|
||||
get { return is_fixed_num_decimals_forced; }
|
||||
set { is_fixed_num_decimals_forced = value; }
|
||||
}
|
||||
[JsonProperty("is_decimal_separator_comma")]
|
||||
public bool? IsDecimalSeparatorComma
|
||||
{
|
||||
get { return is_decimal_separator_comma; }
|
||||
set { is_decimal_separator_comma = value; }
|
||||
}
|
||||
[JsonProperty("is_thousand_separator_disabled")]
|
||||
public bool? IsThousandSeparatorDisabled
|
||||
{
|
||||
get { return is_thousand_separator_disabled; }
|
||||
set { is_thousand_separator_disabled = value; }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);
|
||||
using (JsonWriter writer = new JsonWriter(sw))
|
||||
{
|
||||
writer.SkipNullValue = true;
|
||||
writer.Write(this);
|
||||
}
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
public string ToPrettyString()
|
||||
{
|
||||
StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);
|
||||
using (JsonWriter writer = new JsonWriter(sw))
|
||||
{
|
||||
writer.SkipNullValue = true;
|
||||
writer.PrettyPrint = true;
|
||||
writer.Write(this);
|
||||
}
|
||||
return sw.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Web;
|
||||
using System.Web.Caching;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
[Designer(typeof(ChartControlDesigner)), Description("Chart control for open flash chart"), ToolboxData("<{0}:OpenFlashChartControl runat=\"server\" ></{0}:OpenFlashChartControl>")]
|
||||
public class OpenFlashChartControl : Control
|
||||
{
|
||||
private string width;
|
||||
private string height;
|
||||
private string externalSWFfile;
|
||||
private string externalSWFObjectFile;
|
||||
private string loadingmsg;
|
||||
private OpenFlashChart chart;
|
||||
private string chart_json;
|
||||
private bool _enableCache;
|
||||
/// <summary>
|
||||
/// Used to hold internal chart
|
||||
/// </summary>
|
||||
public OpenFlashChart Chart
|
||||
{
|
||||
get
|
||||
{
|
||||
return chart;
|
||||
}
|
||||
set
|
||||
{
|
||||
chart = value;
|
||||
chart_json = value.ToString();
|
||||
ViewState["chart_json"] = chart_json;
|
||||
}
|
||||
}
|
||||
|
||||
private string ChartJson
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["chart_json"] != null)
|
||||
return ViewState["chart_json"].ToString();
|
||||
return chart_json;
|
||||
}
|
||||
}
|
||||
private string datafile;
|
||||
|
||||
[DefaultValue("600px")]
|
||||
[Category("Appearance")]
|
||||
[PersistenceMode(PersistenceMode.Attribute)]
|
||||
public string Width
|
||||
{
|
||||
get
|
||||
{
|
||||
width = "600px";
|
||||
if (this.ViewState["width"] != null)
|
||||
{
|
||||
width = this.ViewState["width"].ToString();
|
||||
}
|
||||
return width;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!value.EndsWith("%") && !value.EndsWith("px"))
|
||||
value = value + "px";
|
||||
this.ViewState["width"] = value;
|
||||
width = value;
|
||||
}
|
||||
}
|
||||
[DefaultValue("300px")]
|
||||
[Category("Appearance")]
|
||||
[PersistenceMode(PersistenceMode.Attribute)]
|
||||
public string Height
|
||||
{
|
||||
get
|
||||
{
|
||||
height = "300px";
|
||||
if (this.ViewState["height"] != null)
|
||||
{
|
||||
height = this.ViewState["height"].ToString();
|
||||
}
|
||||
return height;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!value.EndsWith("%") && !value.EndsWith("px"))
|
||||
value = value + "px";
|
||||
this.ViewState["height"] = value;
|
||||
height = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Appearance")]
|
||||
[PersistenceMode(PersistenceMode.Attribute)]
|
||||
public string ExternalSWFfile
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ViewState["externalswffile"] != null)
|
||||
{
|
||||
externalSWFfile = this.ViewState["externalswffile"].ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(externalSWFfile))
|
||||
{
|
||||
if (externalSWFfile.StartsWith("~"))
|
||||
{
|
||||
externalSWFfile = this.ResolveUrl(externalSWFfile);
|
||||
}
|
||||
}
|
||||
return externalSWFfile;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ViewState["externalswffile"] = value.Trim();
|
||||
externalSWFfile = value.Trim();
|
||||
}
|
||||
}
|
||||
[Category("Appearance")]
|
||||
[PersistenceMode(PersistenceMode.Attribute)]
|
||||
public string ExternalSWFObjectFile
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ViewState["externalswfobjectfile"] != null)
|
||||
{
|
||||
externalSWFObjectFile = this.ViewState["externalswfobjectfile"].ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(externalSWFObjectFile))
|
||||
{
|
||||
if (externalSWFObjectFile.StartsWith("~"))
|
||||
{
|
||||
externalSWFObjectFile = this.ResolveUrl(externalSWFObjectFile);
|
||||
}
|
||||
}
|
||||
return externalSWFObjectFile;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ViewState["externalswfobjectfile"] = value.Trim();
|
||||
externalSWFObjectFile = value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string DataFile
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ViewState["datafile"] != null)
|
||||
{
|
||||
datafile = this.ViewState["datafile"].ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(datafile))
|
||||
{
|
||||
if (datafile.StartsWith("~"))
|
||||
{
|
||||
datafile = this.ResolveUrl(datafile);
|
||||
}
|
||||
}
|
||||
|
||||
return datafile;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ViewState["datafile"] = value;
|
||||
datafile = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string LoadingMsg
|
||||
{
|
||||
get { return loadingmsg; }
|
||||
set { loadingmsg = value; }
|
||||
}
|
||||
|
||||
public bool EnableCache
|
||||
{
|
||||
get { return _enableCache; }
|
||||
set { _enableCache = value; }
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
const string key = "swfobject";
|
||||
string swfobjectfile = ExternalSWFObjectFile;
|
||||
if (string.IsNullOrEmpty(ExternalSWFObjectFile))
|
||||
swfobjectfile = Page.ClientScript.GetWebResourceUrl(this.GetType(), "OpenFlashChart.swfobject.js");
|
||||
|
||||
if (!this.Page.ClientScript.IsClientScriptBlockRegistered(key))
|
||||
{
|
||||
this.Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), key, "<script type=\"text/javascript\" src=\"" + swfobjectfile + "\"></script>");
|
||||
}
|
||||
base.OnInit(e);
|
||||
}
|
||||
public override void RenderControl(HtmlTextWriter writer)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (string.IsNullOrEmpty(ExternalSWFfile))
|
||||
ExternalSWFfile = Page.ClientScript.GetWebResourceUrl(this.GetType(), "OpenFlashChart.open-flash-chart.swf");
|
||||
builder.AppendFormat("<div id=\"{0}\">", this.ClientID);
|
||||
builder.AppendLine("</div>");
|
||||
builder.AppendLine("<script type=\"text/javascript\">");
|
||||
builder.AppendFormat("swfobject.embedSWF(\"{0}\", \"{1}\", \"{2}\", \"{3}\",\"9.0.0\", \"expressInstall.swf\",",
|
||||
ExternalSWFfile, this.ClientID, Width, Height);
|
||||
builder.Append("{\"data-file\":\"");
|
||||
//if both chart,datafile exists ,chart win.
|
||||
if (ChartJson != null)
|
||||
{
|
||||
if (!EnableCache)
|
||||
Page.Cache.Remove(this.ClientID);
|
||||
Page.Cache.Add(this.ClientID, ChartJson, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 10, 0),
|
||||
CacheItemPriority.Normal, null);
|
||||
builder.Append("ofc_handler.aspx?chartjson=" + this.ClientID + "%26ec=" + (EnableCache ? "1" : "0"));
|
||||
}
|
||||
else
|
||||
builder.Append(HttpUtility.UrlEncode(DataFile));
|
||||
builder.Append("\"");
|
||||
if (!string.IsNullOrEmpty(loadingmsg))
|
||||
{
|
||||
builder.AppendFormat(",\"loading\":\"{0}\"", loadingmsg);
|
||||
}
|
||||
builder.Append("});");
|
||||
builder.AppendLine("</script>");
|
||||
|
||||
writer.Write(builder.ToString());
|
||||
base.RenderControl(writer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class PieValue
|
||||
{
|
||||
private double val;
|
||||
private string text;
|
||||
private string click;
|
||||
public PieValue(double val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
public static implicit operator PieValue(double val)
|
||||
{
|
||||
return new PieValue(val,"");
|
||||
}
|
||||
public PieValue(double val, string text)
|
||||
{
|
||||
this.val = val;
|
||||
this.Text = text;
|
||||
}
|
||||
[JsonProperty("value")]
|
||||
public double Value
|
||||
{
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
[JsonProperty("label")]
|
||||
public string Text
|
||||
{
|
||||
get { return text; }
|
||||
set { text = value; }
|
||||
}
|
||||
[JsonProperty("on-click")]
|
||||
public string Click
|
||||
{
|
||||
get { return click; }
|
||||
set { click = value; }
|
||||
}
|
||||
}
|
||||
public class Pie : Chart<PieValue>
|
||||
{
|
||||
private int border;
|
||||
private IEnumerable<String> colours;
|
||||
private double alpha;
|
||||
private PieAnimationSeries animate;
|
||||
private double start_angle;
|
||||
private bool? gradientfill;
|
||||
private bool? nolabels;
|
||||
|
||||
public Pie()
|
||||
{
|
||||
this.ChartType = "pie";
|
||||
this.border = 2;
|
||||
this.colours = new string[] { "#d01f3c", "#356aa0", "#C79810" };
|
||||
this.alpha = 0.6;
|
||||
//this.animate = true;
|
||||
//gradientfill = true;
|
||||
|
||||
}
|
||||
[JsonProperty("colours")]
|
||||
public IEnumerable<string> Colours
|
||||
{
|
||||
get { return this.colours; }
|
||||
set
|
||||
{
|
||||
this.colours = value;
|
||||
}
|
||||
}
|
||||
[JsonProperty("border")]
|
||||
public int Border
|
||||
{
|
||||
get { return border; }
|
||||
set { border = value; }
|
||||
}
|
||||
[JsonProperty("alpha")]
|
||||
public double Alpha
|
||||
{
|
||||
get { return alpha; }
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
alpha = 0;
|
||||
else if ((value >= 0) && (value <= 1))
|
||||
alpha = value;
|
||||
else if ((value > 1)&&(value<=100))
|
||||
alpha = value/100;
|
||||
else
|
||||
alpha = 1.0;
|
||||
}
|
||||
}
|
||||
[JsonProperty("animate")]
|
||||
public PieAnimationSeries Animate
|
||||
{
|
||||
get { return animate; }
|
||||
set { animate = value; }
|
||||
}
|
||||
[JsonProperty("start-angle")]
|
||||
public double StartAngle
|
||||
{
|
||||
get { return start_angle; }
|
||||
set { start_angle = value; }
|
||||
}
|
||||
[JsonProperty("gradient-fill")]
|
||||
public bool? GradientFillMode
|
||||
{
|
||||
get { return gradientfill; }
|
||||
set { gradientfill = value; }
|
||||
}
|
||||
[JsonProperty("no-labels")]
|
||||
public bool? NoLabels
|
||||
{
|
||||
get { return nolabels; }
|
||||
set { nolabels = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过下列属性集
|
||||
// 控制。更改这些属性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("OpenFlashChart")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenFlashChart")]
|
||||
[assembly: AssemblyCopyright("版权所有 (C) 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 属性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("8203eccb-dc12-4282-9531-a2c47f2120d1")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
|
||||
[assembly: System.Web.UI.WebResource("OpenFlashChart.swfobject.js", "text/javascript")]
|
||||
[assembly: System.Web.UI.WebResource("OpenFlashChart.open-flash-chart.swf", "application/x-shockwave-flash")]
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class RadarAxis:XAxis
|
||||
{
|
||||
private XAxisLabels spokelabels;
|
||||
public RadarAxis(double max)
|
||||
{
|
||||
base.Max = max;
|
||||
}
|
||||
public RadarAxis()
|
||||
{
|
||||
|
||||
}
|
||||
[JsonProperty("spoke-labels")]
|
||||
public XAxisLabels SpokeLabels
|
||||
{
|
||||
get { return spokelabels; }
|
||||
set { spokelabels = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class ScatterValue
|
||||
{
|
||||
private double x;
|
||||
private double y;
|
||||
private int? dotsize;
|
||||
private string dottype;
|
||||
private string onclick;
|
||||
public ScatterValue(double x, double y)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
public ScatterValue(double x, double y, int dotsize)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
if (dotsize > 0)
|
||||
this.dotsize = dotsize;
|
||||
//this.dottype = DotType.HOLLOW_DOT;
|
||||
}
|
||||
|
||||
[JsonProperty("x")]
|
||||
public double X
|
||||
{
|
||||
get{return x;}
|
||||
set{this.x=value;}
|
||||
}
|
||||
[JsonProperty("y")]
|
||||
public double Y
|
||||
{
|
||||
get{return y;}
|
||||
set{this.y=value;}
|
||||
}
|
||||
[JsonProperty("dot-size")]
|
||||
public int DotSize
|
||||
{
|
||||
get{
|
||||
if (dotsize == null)
|
||||
return -1;
|
||||
|
||||
return dotsize.Value;}
|
||||
set{this.dotsize=value;}
|
||||
}
|
||||
[JsonProperty("type")]
|
||||
public string DotType
|
||||
{
|
||||
get { return dottype; }
|
||||
set { dottype = value; }
|
||||
}
|
||||
[JsonProperty("on-click")]
|
||||
public string OnClick
|
||||
{
|
||||
get { return onclick; }
|
||||
set { onclick = value; }
|
||||
}
|
||||
}
|
||||
public class Scatter:Chart<ScatterValue>
|
||||
{
|
||||
private int? dotsize;
|
||||
public Scatter()
|
||||
{
|
||||
this.ChartType = "scatter";
|
||||
}
|
||||
public Scatter(string color,int? dotsize)
|
||||
{
|
||||
this.ChartType = "scatter";
|
||||
this.Colour = color;
|
||||
this.dotsize = dotsize;
|
||||
DotStyleType.Type = DotType.SOLID_DOT;
|
||||
}
|
||||
[JsonProperty("dot-size")]
|
||||
public int? DotSize
|
||||
{
|
||||
get { return this.dotsize; }
|
||||
set { this.dotsize = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class Title : ChartElement
|
||||
{
|
||||
public Title(string text)
|
||||
{
|
||||
base.Text = text;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
//{
|
||||
// shadow: true,
|
||||
// rounded: 1,
|
||||
// stroke: 2,
|
||||
// colour: '#808080',
|
||||
// background: '#f0f0f0',
|
||||
// title: "color: #0000F0; font-weight: bold; font-size: 12;",
|
||||
// body: "color: #000000; font-weight: normal; font-size: 12;",
|
||||
// mouse: Tooltip.CLOSEST,
|
||||
// text: "_default"
|
||||
//}
|
||||
public class ToolTip
|
||||
{
|
||||
string text="_default";
|
||||
private bool shadow=true ;
|
||||
private int rounded=1;
|
||||
private int stroke = 2;
|
||||
private string colour;//= "#808080";
|
||||
private string background;//= "#f0f0f0";
|
||||
private string titlestyle;// = "color: #0000F0; font-weight: bold; font-size: 12;";
|
||||
private string bodystyle;//= "color: #000000; font-weight: normal; font-size: 12;";
|
||||
private ToolTipStyle mousestyle;//= ToolTipStyle.CLOSEST;
|
||||
|
||||
public int mouse;
|
||||
|
||||
public ToolTip(string text)
|
||||
{
|
||||
this.text = text;
|
||||
}
|
||||
[JsonProperty("text")]
|
||||
public String Text
|
||||
{
|
||||
get { return text; }
|
||||
set { text = value; }
|
||||
}
|
||||
[JsonProperty("shadow")]
|
||||
public bool Shadow
|
||||
{
|
||||
get { return shadow; }
|
||||
set { shadow = value; }
|
||||
}
|
||||
[JsonProperty("rounded")]
|
||||
public int Rounded
|
||||
{
|
||||
get { return rounded; }
|
||||
set { rounded = value; }
|
||||
}
|
||||
[JsonProperty("stroke")]
|
||||
public int Stroke
|
||||
{
|
||||
get { return stroke; }
|
||||
set { stroke = value; }
|
||||
}
|
||||
[JsonProperty("colour")]
|
||||
public string Colour
|
||||
{
|
||||
get { return colour; }
|
||||
set { colour = value; }
|
||||
}
|
||||
[JsonProperty("background")]
|
||||
public string BackgroundColor
|
||||
{
|
||||
get { return background; }
|
||||
set { background = value; }
|
||||
}
|
||||
[JsonProperty("title")]
|
||||
public string TitleStyle
|
||||
{
|
||||
get { return titlestyle; }
|
||||
set { titlestyle = value; }
|
||||
}
|
||||
[JsonProperty("body")]
|
||||
public string BodyStyle
|
||||
{
|
||||
get { return bodystyle; }
|
||||
set { bodystyle = value; }
|
||||
}
|
||||
[JsonIgnore]
|
||||
public ToolTipStyle MouseStyle
|
||||
{
|
||||
get { return mousestyle; }
|
||||
set { mousestyle = value;
|
||||
mouse = (int) value;
|
||||
}
|
||||
}
|
||||
public void SetProximity()
|
||||
{
|
||||
mouse = 1;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
public enum ToolTipStyle
|
||||
{
|
||||
CLOSEST=0,
|
||||
FOLLOW=1,
|
||||
NORMAL=2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace OpenFlashChart.WebHandler
|
||||
{
|
||||
public class ofcHandler: IHttpHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface.
|
||||
/// </summary>
|
||||
/// <param name="context">An <see cref="T:System.Web.HttpContext" /> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests. </param>
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{
|
||||
using (TextWriter writer = new HtmlTextWriter(context.Response.Output))
|
||||
{
|
||||
string chartID = context.Request.QueryString["chartjson"];
|
||||
if (chartID == null)
|
||||
return;
|
||||
string chartjson = (string)context.Cache[chartID];
|
||||
context.Response.Clear();
|
||||
context.Response.CacheControl = "no-cache";
|
||||
|
||||
writer.Write(chartjson);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler" /> instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// true if the <see cref="T:System.Web.IHttpHandler" /> instance is reusable; otherwise, false.
|
||||
/// </returns>
|
||||
public bool IsReusable
|
||||
{
|
||||
get { return true;}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class XAxis:Axis
|
||||
{
|
||||
private string tick_height;
|
||||
private XAxisLabels labels;
|
||||
|
||||
[JsonProperty("tick-height")]
|
||||
public string TickHeight
|
||||
{
|
||||
get { return tick_height; }
|
||||
set { tick_height = value; }
|
||||
}
|
||||
|
||||
[JsonProperty("labels")]
|
||||
public XAxisLabels Labels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.labels == null)
|
||||
this.labels = new XAxisLabels();
|
||||
return this.labels;
|
||||
}
|
||||
set { this.labels = value; }
|
||||
}
|
||||
public void SetLabels(IList<string> labelsvalue)
|
||||
{
|
||||
Labels.SetLabels(labelsvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class XAxisLabels:AxisLabels
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class YAxis:Axis
|
||||
{
|
||||
private int tick_length;
|
||||
private YAxisLabels labels;
|
||||
[JsonProperty("tick-length")]
|
||||
public int TickLength
|
||||
{
|
||||
get { return tick_length; }
|
||||
set { tick_length = value; }
|
||||
}
|
||||
|
||||
public void SetRange(double min, double max, int step)
|
||||
{
|
||||
base.Max = max;
|
||||
base.Min = min;
|
||||
base.Steps = step;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[JsonProperty("labels")]
|
||||
public YAxisLabels Labels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.labels == null)
|
||||
this.labels = new YAxisLabels();
|
||||
return this.labels;
|
||||
}
|
||||
set { this.labels = value; }
|
||||
}
|
||||
public void SetLabels(IList<string> labelsvalue)
|
||||
{
|
||||
Labels.SetLabels(labelsvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using JsonFx.Json;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class YAxisLabel:AxisLabel
|
||||
{
|
||||
private int? y;
|
||||
[JsonProperty("y")]
|
||||
public int? Y
|
||||
{
|
||||
get { return y; }
|
||||
set { y = value; }
|
||||
}
|
||||
public YAxisLabel(string text,int ypos):base(text)
|
||||
{
|
||||
y = ypos;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class YAxisLabels:AxisLabels
|
||||
{
|
||||
public override void SetLabels(IList<string> labelsvalue)
|
||||
{
|
||||
int pos = 0;
|
||||
if (labels == null)
|
||||
labels = new List<object>();
|
||||
foreach (string s in labelsvalue)
|
||||
{
|
||||
labels.Add(s);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenFlashChart
|
||||
{
|
||||
public class YAxisRight:YAxis
|
||||
{
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using ToolTip=OpenFlashChart.ToolTip;
|
||||
using ToolTipStyle=OpenFlashChart.ToolTipStyle;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
ArrayList data1 = new ArrayList();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
int temp = rand.Next(30);
|
||||
if (temp > 20)
|
||||
data1.Add(new LineDotValue(temp, "#fe0"));
|
||||
else
|
||||
{
|
||||
data1.Add(temp);
|
||||
}
|
||||
}
|
||||
|
||||
OpenFlashChart.LineHollow line1 = new LineHollow();
|
||||
line1.Values = data1;
|
||||
line1.HaloSize = 0;
|
||||
line1.Width = 2;
|
||||
line1.DotSize = 5;
|
||||
|
||||
line1.Tooltip = "提示:#val#";
|
||||
|
||||
chart.AddElement(line1);
|
||||
|
||||
chart.Title = new Title("line演示");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
chart.Tooltip = new ToolTip("全局提示:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
OpenFlashChartControl1.EnableCache = false;
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
chart.Title = new Title("new Title");
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
protected void Button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
chart.Title = new Title("default title");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class Animation_AreaAnimation : System.Web.UI.Page
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
OpenFlashChart.Area area = new Area();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
ArrayList data1 = new ArrayList();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
int temp = rand.Next(30);
|
||||
data1.Add(temp);
|
||||
|
||||
}
|
||||
|
||||
area.Values = data1;
|
||||
area.HaloSize = 0;
|
||||
area.Width = 2;
|
||||
area.DotSize = 5;
|
||||
|
||||
area.Tooltip = "Tooltip:#val#";
|
||||
|
||||
chart.AddElement(area);
|
||||
|
||||
chart.Title = new Title("Area Animation Demo");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
chart.Tooltip = new ToolTip("Global tip:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
OpenFlashChartControl1.EnableCache = false;
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Animation animation = new Animation();
|
||||
animation.Type = DropDownList1.SelectedValue;
|
||||
try
|
||||
{
|
||||
animation.Cascade = double.Parse(TextBox1.Text);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
TextBox1.Text = "1";
|
||||
animation.Cascade = 1;
|
||||
}
|
||||
try
|
||||
{
|
||||
animation.Delay = double.Parse(TextBox2.Text);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
TextBox2.Text = "0.5";
|
||||
animation.Delay = 0.5;
|
||||
}
|
||||
area.OnShowAnimation = animation;
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class Animation_LineAnimtion : System.Web.UI.Page
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
OpenFlashChart.LineHollow line1 = new LineHollow();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
ArrayList data1 = new ArrayList();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
int temp = rand.Next(30);
|
||||
if (temp > 20)
|
||||
data1.Add(new LineDotValue(temp, "#fe0"));
|
||||
else
|
||||
{
|
||||
data1.Add(temp);
|
||||
}
|
||||
}
|
||||
|
||||
line1.Values = data1;
|
||||
line1.HaloSize = 0;
|
||||
line1.Width = 2;
|
||||
line1.DotSize = 5;
|
||||
|
||||
line1.Tooltip = "提示:#val#";
|
||||
|
||||
chart.AddElement(line1);
|
||||
|
||||
chart.Title = new Title("line演示");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
chart.Tooltip = new ToolTip("全局提示:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
OpenFlashChartControl1.EnableCache = false;
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Animation animation = new Animation();
|
||||
animation.Type = DropDownList1.SelectedValue;
|
||||
try
|
||||
{
|
||||
animation.Cascade = double.Parse(TextBox1.Text);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
TextBox1.Text = "1";
|
||||
animation.Cascade = 1;
|
||||
}
|
||||
try
|
||||
{
|
||||
animation.Delay = double.Parse(TextBox2.Text);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
TextBox2.Text = "0.5";
|
||||
animation.Delay = 0.5;
|
||||
}
|
||||
line1.OnShowAnimation = animation;
|
||||
OpenFlashChartControl1.Chart = chart;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class BarType : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class Candle : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class ChineseCharacter : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class GlassBar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class Hbar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class datafile_Line : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class LineHollow : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class NumFormat : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class Pie : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class Scatter : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class ScatterLine : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class Tooltip : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class area : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class bar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class bar3d : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class barsketch : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
public partial class chartcontrol : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class datafile_BarTypeTest : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
chart.Title = new Title("Bar Chart");
|
||||
|
||||
Bar bar = new OpenFlashChart.Bar();
|
||||
Random random = new Random();
|
||||
bar.Colour = "#345";
|
||||
bar.BarType = BarType.BAR_DOME;
|
||||
bar.FillAlpha = 0.4;
|
||||
bar.Text = "Test";
|
||||
|
||||
bar.FontSize = 10;
|
||||
List<double> values = new List<double>();
|
||||
for (int i = 0; i < 12; i++)
|
||||
values.Add(random.Next(i, i * 2));
|
||||
bar.Values = values;
|
||||
chart.AddElement(bar);
|
||||
//XAxis xaxis = new XAxis();
|
||||
//// xaxis.Labels = new AxisLabel("text","#ef0",10,"vertical");
|
||||
//xaxis.Steps = 1;
|
||||
//xaxis.Offset = true;
|
||||
////xaxis.SetRange(-2, 15);
|
||||
//chart.X_Axis = xaxis;
|
||||
//YAxis yaxis = new YAxis();
|
||||
//yaxis.Steps = 4;
|
||||
//yaxis.SetRange(0, 20);
|
||||
//chart.Y_Axis = yaxis;
|
||||
chart.Y_Axis.SetRange(0, 24, 3);
|
||||
bar.Tooltip = "提示:#top#<br>#bottom#<br>#val#";
|
||||
string s = chart.ToPrettyString();
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(s);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class datafile_Candle : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
chart.Title = new Title("Bar Chart");
|
||||
|
||||
Candle candle = new OpenFlashChart.Candle();
|
||||
Random random = new Random();
|
||||
candle.Colour = "#345";
|
||||
|
||||
candle.FillAlpha = 0.4;
|
||||
candle.Text = "Test";
|
||||
|
||||
candle.FontSize = 10;
|
||||
ArrayList values = new ArrayList();
|
||||
for (int i = 0; i < 12; i++)
|
||||
values.Add(new CandleValue(random.Next(20,30),random.Next(15,20),random.Next(10,15),random.Next(5,10)));
|
||||
candle.Values = values;
|
||||
chart.AddElement(candle);
|
||||
//XAxis xaxis = new XAxis();
|
||||
//// xaxis.Labels = new AxisLabel("text","#ef0",10,"vertical");
|
||||
//xaxis.Steps = 1;
|
||||
//xaxis.Offset = true;
|
||||
////xaxis.SetRange(-2, 15);
|
||||
//chart.X_Axis = xaxis;
|
||||
//YAxis yaxis = new YAxis();
|
||||
//yaxis.Steps = 4;
|
||||
//yaxis.SetRange(0, 20);
|
||||
//chart.Y_Axis = yaxis;
|
||||
|
||||
chart.Y_Axis.SetRange(0, 24, 3);
|
||||
candle.Tooltip = "提示:#top#<br>#bottom#<br>#val#";
|
||||
string s = chart.ToPrettyString();
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(s);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class ChineseCharacter : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<double> data1 = new List<double>();
|
||||
|
||||
for (double i = 0; i < 6.2; i += 0.2)
|
||||
{
|
||||
data1.Add(Math.Sin(i) * 1.9 + 7);
|
||||
|
||||
}
|
||||
|
||||
OpenFlashChart.LineHollow line1 = new LineHollow();
|
||||
line1.Values = data1;
|
||||
line1.HaloSize = 1;
|
||||
line1.Width = 2;
|
||||
line1.DotSize = 5;
|
||||
|
||||
|
||||
|
||||
chart.AddElement(line1);
|
||||
chart.Y_Legend = new Legend("Y轴坐标");
|
||||
chart.Title = new Title("中文测试");
|
||||
chart.Y_Axis.SetRange(0, 15, 5);
|
||||
|
||||
chart.X_Axis.SetLabels(new string[] { "中文测试" ,"第二"});
|
||||
|
||||
chart.X_Axis.Steps = 2;
|
||||
chart.X_Axis.Labels.VisibleSteps = 2;
|
||||
|
||||
chart.X_Axis.Labels.Vertical = true;
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToPrettyString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using Bar=OpenFlashChart.Bar;
|
||||
using ToolTip=OpenFlashChart.ToolTip;
|
||||
using YAxis=OpenFlashChart.YAxis;
|
||||
|
||||
public partial class datafile_GlassBar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
chart.Title = new Title("Bar Chart");
|
||||
|
||||
BarGlass bar = new OpenFlashChart.BarGlass();
|
||||
Random random = new Random();
|
||||
bar.Colour = "#345";
|
||||
|
||||
bar.FillAlpha = 0.4;
|
||||
bar.Text = "Test";
|
||||
|
||||
bar.FontSize = 10;
|
||||
List<BarGlassValue> values = new List<BarGlassValue>();
|
||||
for (int i = 0; i < 11; i++)
|
||||
{
|
||||
|
||||
values.Add(new BarGlassValue(random.Next(i, i * 2)));
|
||||
}
|
||||
BarGlassValue barGlassValue = new BarGlassValue(4);
|
||||
barGlassValue.Tip = "#bottom#:top#top#<br>#val#";
|
||||
barGlassValue.Color = "#eee";
|
||||
values.Add(barGlassValue);
|
||||
bar.Values = values;
|
||||
chart.AddElement(bar);
|
||||
YAxis yaxis = new YAxis();
|
||||
yaxis.Steps = 4;
|
||||
yaxis.SetRange(0, 20);
|
||||
chart.Y_Axis = yaxis;
|
||||
chart.Y_Axis.SetRange(0, 24, 3);
|
||||
chart.Tooltip = new ToolTip("提示:#val#");
|
||||
string s = chart.ToPrettyString();
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(s);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
public partial class datafile_HBar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
chart.Title = new Title("Bar Chart");
|
||||
|
||||
HBar bar = new OpenFlashChart.HBar();
|
||||
bar.Colour = "#345";
|
||||
|
||||
bar.FillAlpha = 0.4;
|
||||
bar.Text = "Test";
|
||||
|
||||
bar.FontSize = 10;
|
||||
bar.Add(new HBarValue(0,5));
|
||||
bar.Add(new HBarValue(6, 8));
|
||||
bar.Add(new HBarValue(8, 10));
|
||||
chart.AddElement(bar);
|
||||
//chart.Y_Axis.SetLabels(new string[] { "hbar1", "hbar2", "hbar3" });
|
||||
//chart.Y_Axis.Labels.Steps = 3;
|
||||
chart.Tooltip = new ToolTip("提示:#val#");
|
||||
string s = chart.ToPrettyString();
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(s);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class datafile_Line : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<double> data1 = new List<double>();
|
||||
List<double> data2 = new List<double>();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for(double i=0;i<12;i++)
|
||||
{
|
||||
data1.Add(rand.Next(30));
|
||||
data2.Add(rand.Next(50));
|
||||
}
|
||||
|
||||
OpenFlashChart.Line line1 = new Line();
|
||||
line1.Values = data1;
|
||||
line1.HaloSize = 0;
|
||||
line1.Width = 2;
|
||||
line1.DotSize = 5;
|
||||
line1.DotStyleType.Tip = "#x_label#<br>#val#";
|
||||
//line1.DotStyleType.Type = DotType.ANCHOR;
|
||||
//line1.DotStyleType.Type = DotType.BOW;
|
||||
line1.DotStyleType.Colour = "#467533";
|
||||
line1.Tooltip = "#x_label#<br>提示:#val#";
|
||||
|
||||
OpenFlashChart.Line line2 = new Line();
|
||||
line2.Values = data2;
|
||||
line2.HaloSize = 1;
|
||||
line2.Width = 3;
|
||||
line2.DotSize = 4;
|
||||
line2.DotStyleType.Tip = "#x_label#<br>#val#";
|
||||
line1.DotStyleType.Type = DotType.ANCHOR;
|
||||
//line1.DotStyleType.Type = DotType.BOW;
|
||||
line2.DotStyleType.Colour = "#fe4567";
|
||||
line2.Tooltip = "提示:#val#";
|
||||
line2.AttachToRightAxis(true);
|
||||
|
||||
chart.AddElement(line1);
|
||||
chart.AddElement(line2);
|
||||
chart.Y_Legend=new Legend("中文test");
|
||||
chart.Title = new Title("line演示");
|
||||
chart.Y_Axis.SetRange(0,35,5);
|
||||
chart.X_Axis.Labels.Color = "#e43456";
|
||||
chart.X_Axis.Labels.VisibleSteps = 3;
|
||||
chart.Y_Axis.Labels.FormatString = "$#val#";
|
||||
chart.X_Axis.SetLabels(new string[]{"test1","test2"});
|
||||
//chart.Y_Axis.SetLabels(new string[] { "test1", "test2", "test1", "test2", "test1", "test2" });
|
||||
chart.X_Axis.Steps = 4;
|
||||
chart.Y_Axis.Steps = 3;
|
||||
chart.Y_Axis.Colour = "#ef6745";
|
||||
chart.Y_Axis.Labels.Color = "#ef6745";
|
||||
chart.Y_Axis.Offset = true;
|
||||
chart.Y_RightLegend = new Legend("test y legend right");
|
||||
chart.Y_Axis_Right = new YAxis();
|
||||
chart.Y_Axis_Right.Steps = 8;
|
||||
chart.Y_Axis_Right.TickLength = 4;
|
||||
chart.Y_Axis.TickLength = 4;
|
||||
chart.Y_Axis_Right.SetRange(0,60);
|
||||
|
||||
chart.Tooltip = new ToolTip("全局提示:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToPrettyString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using Legend=OpenFlashChart.Legend;
|
||||
using LineHollow=OpenFlashChart.LineHollow;
|
||||
|
||||
public partial class datafile_LineHollow : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<double> data1 = new List<double>();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
data1.Add(rand.Next(30));
|
||||
}
|
||||
|
||||
OpenFlashChart.LineHollow line1 = new LineHollow();
|
||||
line1.Values = data1;
|
||||
line1.HaloSize = 0;
|
||||
line1.Width = 2;
|
||||
line1.DotSize = 5;
|
||||
line1.DotStyleType.Tip = "#x_label#<br>#val#";
|
||||
//line1.DotStyleType.Type = DotType.ANCHOR;
|
||||
//line1.DotStyleType.Type = DotType.BOW;
|
||||
line1.DotStyleType.Colour = "#467533";
|
||||
line1.Tooltip = "提示:#val#";
|
||||
|
||||
chart.AddElement(line1);
|
||||
chart.Y_Legend = new Legend("中文test");
|
||||
chart.Title = new Title("line演示");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
chart.X_Axis.Labels.Color = "#e43456";
|
||||
chart.X_Axis.Steps = 4;
|
||||
chart.Y_Axis.Steps = 3;
|
||||
chart.Tooltip = new ToolTip("全局提示:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToPrettyString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using AreaLine=OpenFlashChart.AreaLine;
|
||||
using DotType=OpenFlashChart.DotType;
|
||||
using ToolTip=OpenFlashChart.ToolTip;
|
||||
using ToolTipStyle=OpenFlashChart.ToolTipStyle;
|
||||
|
||||
public partial class datafile_NumFormat : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<double> data1 = new List<double>();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
data1.Add(rand.Next(30));
|
||||
}
|
||||
|
||||
OpenFlashChart.Area area = new Area();
|
||||
area.Values = data1;
|
||||
area.HaloSize = 0;
|
||||
area.Width = 2;
|
||||
area.DotSize = 5;
|
||||
area.DotStyleType.Tip = "#x_label#<br>#val#";
|
||||
//area.DotStyleType.Type = DotType.ANCHOR;
|
||||
//area.DotStyleType.Type = DotType.BOW;
|
||||
area.DotStyleType.Colour = "#467533";
|
||||
area.Tooltip = "提示:#val#";
|
||||
|
||||
chart.AddElement(area);
|
||||
chart.Y_Legend = new Legend("中文test");
|
||||
chart.Title = new Title("line演示");
|
||||
chart.Y_Axis.SetRange(0, 30000,10000);
|
||||
chart.X_Axis.Labels.Color = "#e43456";
|
||||
chart.X_Axis.Steps = 4;
|
||||
|
||||
|
||||
//num format
|
||||
chart.IsDecimalSeparatorComma = true;
|
||||
chart.NumDecimals = 3;
|
||||
chart.IsFixedNumDecimalsForced = true;
|
||||
|
||||
chart.Tooltip = new ToolTip("全局提示:#val#");
|
||||
chart.Tooltip.Shadow = true;
|
||||
chart.Tooltip.Colour = "#e43456";
|
||||
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToPrettyString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenFlashChart;
|
||||
|
||||
public partial class Pie : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
chart.Title = new Title("Pie Chart");
|
||||
|
||||
OpenFlashChart.Pie pie = new OpenFlashChart.Pie();
|
||||
Random random = new Random();
|
||||
|
||||
List<PieValue> values = new List<PieValue>();
|
||||
List<string> labels = new List<string>();
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
values.Add(new PieValue(random.NextDouble(),"Pie"+i));
|
||||
labels.Add(i.ToString());
|
||||
}
|
||||
//values.Add(0.2);
|
||||
PieValue pieValue = new PieValue(10);
|
||||
pieValue.Click = "http://xiao-yifang.blogspot.com";
|
||||
values.Add(pieValue);
|
||||
pie.Values = values;
|
||||
pie.FontSize = 20;
|
||||
pie.Alpha = .5;
|
||||
PieAnimationSeries pieAnimationSeries = new PieAnimationSeries();
|
||||
pieAnimationSeries.Add(new PieAnimation("bounce", 5));
|
||||
pie.Animate = pieAnimationSeries;
|
||||
//pie.GradientFillMode = false;
|
||||
|
||||
//pie.FillAlpha = 10;
|
||||
|
||||
//pie.Colour = "#fff";
|
||||
pie.Colours = new string[]{"#04f","#1ff","#6ef","#f30"};
|
||||
pie.Tooltip="#label#,#val# of #total##percent# of 100%";
|
||||
chart.AddElement(pie);
|
||||
chart.Bgcolor = "#202020";
|
||||
string s = chart.ToPrettyString();
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(s);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using LineHollow=OpenFlashChart.LineHollow;
|
||||
using ToolTip=OpenFlashChart.ToolTip;
|
||||
using ToolTipStyle=OpenFlashChart.ToolTipStyle;
|
||||
|
||||
public partial class datafile_Scatter : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<ScatterValue> data1 = new List<ScatterValue>();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
data1.Add(new ScatterValue(i,rand.Next(30),5));
|
||||
}
|
||||
|
||||
OpenFlashChart.Scatter line1 = new Scatter("#876543",10);
|
||||
line1.Values = data1;
|
||||
chart.AddElement(line1);
|
||||
|
||||
chart.Title = new Title("Scatter Demo");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
|
||||
chart.X_Axis.SetRange(0,13);
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using Scatter=OpenFlashChart.Scatter;
|
||||
using ScatterValue=OpenFlashChart.ScatterValue;
|
||||
|
||||
public partial class datafile_ScatterLine : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<ScatterValue> data1 = new List<ScatterValue>();
|
||||
Random rand = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 12; i++)
|
||||
{
|
||||
data1.Add(new ScatterValue(i, rand.Next(30), 5));
|
||||
}
|
||||
|
||||
OpenFlashChart.LineScatter line1 = new LineScatter();
|
||||
line1.Values = data1;
|
||||
chart.AddElement(line1);
|
||||
line1.Colour = "#823445";
|
||||
chart.Title = new Title("Scatter Line Demo");
|
||||
chart.Y_Axis.SetRange(0, 35, 5);
|
||||
|
||||
chart.X_Axis.SetRange(0, 13);
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using OpenFlashChart;
|
||||
using ToolTip=OpenFlashChart.ToolTip;
|
||||
|
||||
public partial class Tooltip : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
||||
List<double> data3 = new List<double>();
|
||||
Random random = new Random(DateTime.Now.Millisecond);
|
||||
for (double i = 0; i < 10; i ++)
|
||||
{
|
||||
data3.Add(random.Next(-10,12));
|
||||
}
|
||||
|
||||
|
||||
OpenFlashChart.LineHollow line3 = new LineHollow();
|
||||
line3.Values = data3;
|
||||
line3.HaloSize = 2;
|
||||
line3.Width = 6;
|
||||
line3.DotSize = 4;
|
||||
line3.FontSize = 12;
|
||||
|
||||
|
||||
line3.Text = "line3";
|
||||
|
||||
line3.Tooltip = "my tip #val#";
|
||||
|
||||
chart.AddElement(line3);
|
||||
chart.Title = new Title("Tooltip Demo");
|
||||
chart.Y_Axis.SetRange(-10, 15, 5);
|
||||
|
||||
chart.Tooltip = new ToolTip("my tip #val#");
|
||||
|
||||
Response.Clear();
|
||||
Response.CacheControl = "no-cache";
|
||||
Response.Write(chart.ToPrettyString());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user