ChartDirector開發例項

2021-08-30 01:57:02 字數 2406 閱讀 4476

import="

chartdirector

.*" %>   

// the data for the line chart

doubledata0 = ;   

doubledata1 = ;   

doubledata2 = ;   

// the labels for the line chart

string labels = ;   

//設定圖表的高和寬600*300,背景色為白色

xychart c =newxychart(600

, 300

, 0xeeeeff

, 0x000000

, 1);   

c.setroundedframe();   

//設定繪圖領域為(55,58) 大小為520*195 

//背景色為白色 橫座標和縱座標的網格線顏色

c.setplotarea(55

, 58

, 520

, 195

, 0xffffff

, -1

, -1

, 0xcccccc

, 0xcccccc

);   

//設定網格上邊和標題下邊的區域大小為(50, 30),字橫向排列,字型為宋體,大小為9

c.addlegend(50

, 30

,false, "arial bold"

, 9).setbackground(chart.transparent);   

//設定標題的內容,字型,顏色

, "times new roman bold italic"

, 15

).setbackground(0xccccff

, 0x000000

, chart.glasseffect());   

//設定y軸的標題,字型,大小,顏色

c.yaxis().settitle("mbytes per hour"

);   

//設定x軸的標籤

c.xaxis().setlabels(labels);   

//設定x軸顯示資料的跨度

c.xaxis().setlabelstep(3

);   

//設定x軸標題,字型,大小,顏色

c.xaxis().settitle("jun 12, 2006"

);   

// add a line layer to the chart

linelayer layer = c.addlinelayer2();   

//設定線的寬度2

layer.setlinewidth(2

);   

//填寫資料,設定線的顏色

layer.adddataset(data0, 0xff0000

, "server #1"

);   

layer.adddataset(data1, 0x008800

, "server #2"

);   

layer.adddataset(data2, c.dashlinecolor(0x3333ff

, chart.dashline), "server #3"

);   

//輸出圖表

string chart1url = c.makesession(request, "chart1"

);   

// include tool tip for the chart

string imagemap1 = c.gethtmlimagemap(""

, ""

,   

"title=' hour :  mbytes'"

);   

%>   

"5" leftmargin="5"

rightmargin="0"

>   

"font-size:18pt; font-family:verdana; font-weight:bold"

>   

multi-line chart   

"#000080"

>   

"viewsource.jsp?file="

>   

"2" face="verdana"

>view chart source code

usemap="#map1"

border="0"

>   

"map1"

>

ChartDirector在Pythonr下的安裝

1 在c python27 lib site packages 下建立chartdirector目錄 2 將chartdirector lib子目錄下檔案複製到 c python27 lib site packages chartdirector目錄下 3 在 c python27 lib site...

ChartDirector資料小結

最近在學習web 的圖表開發 用到了jfreechart和chartdirector jfreechart大家應該都很了解了 免費開源的,教程也很多。這裡就不列舉出來了,今天跟大家分享一些chartdirector的東東 官方 它的論壇可以提問,如果英文還可以的話直接在上面提問,回覆挺及時的 cha...

MFC 中ChartDirector 中文亂碼

basechart pie int chartindex const char imagemap the labels for the pie chart const char labels 7 const char labels cstring str0 t 東方0 cstring str1 t ...