1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain" ;
StringBuilder jsonAppend = new
StringBuilder();
jsonAppend.Append( "{" ); //开始标记
jsonAppend.Append( "\"chart\":" );
jsonAppend.Append( "{\"showshadow\": \"0\",\"taskbarroundradius\": \"4\",\"gridbordercolor\": \"99CC00\",\"basefontcolor\": \"333333\",\"ganttlinealpha\": \"20\",\"ganttlinecolor\": \"99CC00\",\"tooltextbordercolor\": \"333333\",\"tooltextbgcolor\": \"FFFFFF\",\"dateformat\": \"dd/mm/yyyy\",\"showtasknames\": \"1\"}," );
jsonAppend.Append( "\"categories\": [{\"fontsize\": \"14\",\"isbold\": \"1\",\"fontcolor\": \"99cc00\",\"bgcolor\": \"333333\",\"category\": [{\"name\": \"2005\",\"end\": \"31/12/2005\",\"start\": \"1/9/2005\"},{\"name\": \"2006\",\"end\": \"31/7/2006\",\"start\": \"1/1/2006\"}]}," );
jsonAppend.Append( "{\"fontsize\": \"10\",\"isbold\": \"1\",\"fontcolor\": \"333333\",\"bgcolor\": \"99cc00\",\"align\": \"center\",\"bgalpha\": \"40\",\"category\": [{\"name\": \"Sep\",\"end\": \"30/9/2005\",\"start\": \"1/9/2005\"},{\"name\": \"Oct\",\"end\": \"31/10/2005\",\"start\": \"1/10/2005\"},{\"name\": \"Nov\",\"end\": \"30/11/2005\",\"start\": \"1/11/2005\"},{\"name\": \"Dec\",\"end\": \"31/12/2005\",\"start\": \"1/12/2005\"},{\"name\": \"Jan\",\"end\": \"31/1/2006\",\"start\": \"1/1/2006\"},{\"name\": \"Feb\",\"end\": \"28/2/2006\",\"start\": \"1/2/2006\"},{\"name\": \"March\",\"end\": \"31/3/2006\",\"start\": \"1/3/2006\"},{\"name\": \"Apr\",\"end\": \"30/4/2006\",\"start\": \"1/4/2006\"},{\"name\": \"May\",\"end\": \"31/5/2006\",\"start\": \"1/5/2006\"},{\"name\": \"June\",\"end\": \"30/6/2006\",\"start\": \"1/6/2006\"},{\"name\": \"July\",\"end\": \"31/7/2006\",\"start\": \"1/7/2006\"}]}]," );
jsonAppend.Append( "\"processes\": {\"fontsize\": \"11\",\"isbold\": \"1\",\"fontcolor\": \"333333\",\"bgcolor\": \"99cc00\",\"align\": \"center\",\"bgalpha\": \"40\",\"headerfontsize\": \"16\",\"headerfontcolor\": \"99CC00\",\"headerbgcolor\": \"333333\",\"isanimated\": \"1\",\"headertext\": \" Leader \",\"positioningrid\": \"right\",\"process\": [{\"name\": \"Mark\",\"id\": \"1\"},{\"name\": \"Tom\",\"id\": \"2\"},{\"name\": \"David\",\"id\": \"3\"},{\"name\": \"Alan\",\"id\": \"4\"},{\"name\": \"Adam\",\"id\": \"5\"},{\"name\": \"Peter\",\"id\": \"6\"}]}," );
jsonAppend.Append( "\"datatable\": {\"fontsize\": \"11\",\"isbold\": \"1\",\"fontcolor\": \"333333\",\"headerfontsize\": \"11\",\"headerfontcolor\": \"000000\",\"showprocessname\": \"1\",\"datacolumn\": [{\"bgcolor\": \"99cc00\",\"align\": \"left\",\"bgalpha\": \"65\",\"headerfontsize\": \"16\",\"headerfontcolor\": \"99cc00\",\"headerbgcolor\": \"333333\",\"headertext\": \" Team\",\"headeralign\": \"left\",\"width\": \"150\",\"text\": [{\"label\": \" MANAGEMENT\"},{\"label\": \" PRODUCT MANAGER\"},{\"label\": \" CORE DEVELOPMENT\"},{\"label\": \" Q & A / DOC.\"},{\"label\": \" WEB TEAM\"},{\"label\": \" MANAGEMENT\"}]}]}," );
jsonAppend.Append( "\"tasks\": {\"width\": \"10\",\"task\": [{\"name\": \"Survey\",\"end\": \"10/10/2005\",\"start\": \"7/9/2005\",\"id\": \"Srvy\",\"toppadding\": \"19\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"1\",\"hovertext\": \"Market Survey\"},{\"name\": \"Concept\",\"end\": \"9/11/2005\",\"start\": \"25/10/2005\",\"id\": \"Cpt1\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"1\",\"hovertext\": \"Develop Concept for Product\"},{\"name\": \"Concept\",\"end\": \"9/11/2005\",\"start\": \"25/10/2005\",\"id\": \"Cpt2\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"2\",\"hovertext\": \"Develop Concept for Product\",\"showlabel\": \"0\"},{\"name\": \"Design\",\"end\": \"25/11/2005\",\"start\":\"12/11/2005\",\"id\": \"Desn\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"2\",\"hovertext\": \"Preliminary Design\"},{\"name\": \"Product Development\",\"end\": \"2/3/2006\",\"start\": \"6/12/2005\",\"id\": \"PD1\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"2\"},{\"name\": \"Product Development\",\"end\":\"2/3/2006\",\"start\": \"6/12/2005\",\"id\": \"PD2\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"3\"},{\"name\": \"Doc Outline\",\"end\": \"1/5/2006\",\"start\": \"6/4/2006\",\"id\": \"DocOut\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"2\",\"hovertext\": \"Documentation Outline\"},{\"name\": \"Alpha\",\"end\":\"2/4/2006\",\"start\": \"15/3/2006\",\"id\": \"alpha\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"4\",\"hovertext\": \"Alpha Release\"},{\"name\": \"Beta\",\"end\": \"2/6/2006\",\"start\":\"10/5/2006\",\"id\": \"Beta\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"3\",\"hovertext\": \"Beta Release\"},{\"name\": \"Doc.\",\"end\": \"29/5/2006\",\"start\": \"12/5/2006\",\"id\": \"Doc\",\"alpha\": \"60\",\"color\":\"99cc00\",\"processid\": \"4\",\"hovertext\": \"Documentation\"},{\"name\": \"Website Design\",\"end\": \"22/6/2006\",\"start\": \"18/5/2006\",\"id\": \"Web\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"5\",\"hovertex\": \"Website Design\"},{\"end\": \"29/7/2006\",\"start\": \"5/7/2006\",\"id\": \"Rls\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"6\",\"hovertext\": \"Product Release\"},{\"name\": \"Dvlp\",\"end\": \"1/7/2006\",\"start\": \"10/6/2006\",\"id\": \"Dvlp\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\":\"3\",\"hovertext\": \"Development on Beta Feedback\"},{\"name\": \"QA\",\"end\": \"22/4/2006\",\"start\": \"9/4/2006\",\"id\": \"QA1\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"4\",\"hovertext\": \"QA Testing\"},{\"name\": \"QA2\",\"end\": \"5/7/2006\",\"start\": \"25/6/2006\",\"id\": \"QA2\",\"alpha\": \"60\",\"color\": \"99cc00\",\"processid\": \"4\",\"hovertext\": \"QA Testing-Phase 2\"}]}," );
jsonAppend.Append( "\"connectors\": [{\"color\": \"99cc00\",\"thickness\": \"2\",\"connector\": [{\"fromtaskconnectstart\": \"1\",\"totaskid\": \"Cpt2\",\"fromtaskid\": \"Cpt1\"},{\"fromtaskconnectstart\": \"1\",\"totaskid\": \"PD2\",\"fromtaskid\": \"PD1\"},{\"totaskid\": \"alpha\",\"fromtaskid\": \"PD1\"},{\"totaskid\": \"alpha\",\"fromtaskid\": \"PD2\"},{\"totaskid\": \"Doc\",\"fromtaskid\": \"DocOut\"}, {\"totaskid\": \"beta\",\"fromtaskid\": \"QA1\"},{\"totaskid\": \"QA2\",\"fromtaskid\": \"Dvlp\"},{\"totaskid\": \"Rls\",\"fromtaskid\": \"QA2\"}]}]," );
jsonAppend.Append( "\"milestones\": {\"milestone\": [{\"color\": \"333333\",\"borderthickness\": \"1\",\"numsides\": \"5\",\"shape\": \"Star\",\"radius\": \"10\",\"taskid\": \"Rls\",\"date\": \"29/7/2006\"},{\"color\": \"333333\",\"borderthickness\": \"1\",\"numsides\": \"5\",\"shape\": \"Star\",\"radius\": \"10\",\"taskid\": \"PD1\",\"date\": \"2/3/2006\"},{\"color\": \"333333\",\"borderthickness\": \"1\",\"numsides\": \"5\",\"shape\": \"Star\",\"radius\": \"10\",\"taskid\": \"PD2\",\"date\": \"2/3/2006\"}]}" );
jsonAppend.Append( "}" ); //结束标记
context.Response.Write(jsonAppend.ToString());
}
|