VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

[分享]簡易統計圖製作(simplechart.vcx)

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
ericchuang



註冊時間: 2007-11-15
文章: 10


第 1 樓

發表發表於: 星期五 四月 25, 2008 12:06 pm    文章主題: [分享]簡易統計圖製作(simplechart.vcx) 引言回覆

最近在研究統計圖表的製作,一直在本站潛水搜尋適合的文件解決我目前的難題; 終於我在 http://www.ml-consult.co.uk/foxst-23.htm 這個網站找到了我要的一個解決方案; 現在, 我也野人獻曝一下, 這個vcx我個人覺得還滿不錯的! 分享給有需要的同好們! 若有版上先進已用過,是否也可以分享一下心得!
以下是此類別的說明文件(在類別內也有):
* Documentation for the class. Not intended to be executed.

* SimpleChart class. Written by Mike Lewis (Mike Lewis Consultants
* Ltd.), February - March 2002.

* Copyright Mike Lewis Consultants Ltd. All rights reserved.
* Feel free to use this class in any way you like, but please
* do not remove our copyright notice or the following disclaimer:

* Although we have tested this class thoroughly, we cannot accept
* any legal liability for its use. Do not use this class unless you
* are satisfied that it works correctly in your application.

* We welcome your feedback. Please email Mike Lewis at mikl@compuserve.com
* or see www.ml-consult.co.uk


* What does it do?

* The SimpleChart class produces two- and three-dimensional charts
* and graphs, using data from a Visual FoxPro table or cursor.


* What do I need?

* The class is based on Microsoft's MSChart ActiveX control
* (MSChrt20.Ocx), which comes with VFP 6.0 and 7.0. To use the
* class, you will need the ActiveX control to be installed on your
* own computer. To distribute applications which use the class,
* you will need to ensure that the OCX file is present and
* properly registered on the end-user's computer.


* How do I use it?

* The first step is to provide a table or cursor which contains
* the data required for your chart. Then drop the class on a VFP
* form, set certain properties, and finally call its CreateChart
* method.


* The cursor

* The chart is always populated with data from a cursor (or
* table). You can use an existing cursor if it already contains
* the required data, or you can create one specifically for this
* purpose.

* The cursor must have the following characteristics:

* - A record for each data point on the chart.

* - A field for each of the series on the chart. These fields must
* be numeric.

* - Optionally, a field containing the row label for the current
* record. This field must be a character string.

* As an example, suppose you wanted to plot monthly sales value
* and monthly sales quantity for the year to date. Your cursor might look
* something like this:

* MONTH_NAME SALES_VAL SALES_QTY
* JAN 4000 32
* FEB 4020 33
* MAR 4090 36
* APR 4070 34

* This will produce a chart with two lines and four
* data points. The horizotal axis will show the four month names
* as labels.


* Minimum properties

* Once you have dropped the SimpleChart control onto a VFP form,
* you must set certain properties. You can do this either in the
* Form Designer or in code (for example, in the control's Init
* event).

* The following are the key properties that you must set:

* cAlias The alias of the cursor (or table) containing the
* data to be plotted.
*
* cData A comma-delimited list of the fields within the
* cusor which contain the actual data.

* In addition, you will probably want to set one or both of the
* following properties:

* cRowLabels The name of the field within the cursor
* containing the row labels (these will appear
* along the x-axis).

* cLabels A comma-delimited list of the labels that are to
* appear in the legend (if any).

* To continue with the above example, the following code sets the
* required properties:

* WITH THIS
* .cAlias = "csrSales"
* .cData = "sales_val,sales_qty"
* .cRowLabels = "month_name"
* .cLabels = "Value,Quantity"
* ENDWITH


* Other properties

* The above properties are the only ones needed to create a
* default chart. However, the class also exposes many other
* properties that can be used to customise the chart in various
* ways. Some of the more important of these are listed below.

* The folowing are native properties of the MSChart control
* (further details can be found in the Help file for the control).


* BorderStyle The border for the entire chart (0 = no
* border, 1 = single line; default 0).

* ChartType 0=3D bar, 1=2D bar, 2=3D line, 3=2D line,
* 4=3D area, 5=2D area, 6=3D step, 7=2D step,
* and several others (default 3).

* ShowLegend .T. to show a legend (default .F.).

* And these are custom properties that you might wish to use:

* cColours A comma-delimited list of the colours to be use
* for the chart. The following colours are supported:
* red, green, blue, black, white, grey, gray, yellow,
* brown, magenta, cyan, darkblue, darkgreen
* For example, if the chart has three series, the following
* code will set these to blue, white and yellow
* respectively:
* THIS.cColours = "BLUE,WHITE,YELLOW"
* (these are not case-sensitive)

* cFootnote Text of a small title which appears at the bottom
* of the chart

* cTitle Text of a main title for the chart; this appears
* centred at the top of the chart

* lIgnoreZero If .T., any zero values in the data will not
* be plotted. (Default .F.).

* lShowMarkers If T., data points will be highlighted by special symbols.
* (Default .F.)


* Creating the chart

* Once you have set the required properties, call the control's
* CreateChart method. This will read the cursor, populate the
* chart with data, and display the chart. The cursor must be open
* when you call this method.


* Things that can go wrong

* If the CreateChart method is unable to create the chart, it
* will return .F. and the chart will not appear. If this happens,
* you should check the following:

* - The cursor or table containing the data must be open, and
* its alias stored in the cAlias property.

* - The cData property must contain the name of at least one of
* the (numeric) fields from the cursor.

*
回頂端
檢視會員個人資料 發送私人訊息
janlih



註冊時間: 2003-11-04
文章: 69


第 2 樓

發表發表於: 星期三 四月 30, 2008 10:28 am    文章主題: 引言回覆

請問樓上大大,table已開,也有數值欄位,可是run後無法顯示,system32資料夾也有mschrt20.ocx

use gcdatapath+"simplechart1.dbf" alias chart1 in 0
select chart1

with thisform.simplechart1
.calias = "chart1"
.cdata = "sales_val,sales_qty"
.crowlabels = "month_name"
.clabels = "value,Quantity"
endwith

已解決

最後要加入 .createchart()
回頂端
檢視會員個人資料 發送私人訊息
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2157


第 3 樓

發表發表於: 星期五 五月 02, 2008 9:25 am    文章主題: 引言回覆

這是另外一套優質統計圖軟體 FoxCharts
http://weblogs.foxite.com/vfpimaging/archive/2008/04/04/5919.aspx
show一張demo給你看看.


已經納入vfpx 裡面, 後續開發沒問題.
下載網頁:
http://www.codeplex.com/VFPX/Release/ProjectReleases.aspx?ReleaseId=12847

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
ericchuang



註冊時間: 2007-11-15
文章: 10


第 4 樓

發表發表於: 星期五 五月 02, 2008 1:59 pm    文章主題: 引言回覆

garfield 寫到:
這是另外一套優質統計圖軟體 FoxCharts
http://weblogs.foxite.com/vfpimaging/archive/2008/04/04/5919.aspx
show一張demo給你看看.
...
http://weblogs.foxite.com/files/vfpimaging/foxcharts/3DDONUTVARIABLE.PNG[/img]

已經納入vfpx 裡面, 後續開發沒問題.
下載網頁:
http://www.codeplex.com/VFPX/Release/ProjectReleases.aspx?ReleaseId=12847



吼! 這個厲害, 對我而言, 這個應該已經算是大師級的應用了! 感謝 garfield大的分享! Laughing
回頂端
檢視會員個人資料 發送私人訊息
ezpos



註冊時間: 2011-04-20
文章: 323


第 5 樓

發表發表於: 星期三 六月 24, 2015 11:56 am    文章主題: 引言回覆

下載點 沒有了
_________________
ezPos收銀機 簡單好用低成本 http://www.ezpos.info
全新美觀的POS收銀機.POS軟硬體耗材.
軟體客制化.網站規劃....能賺錢的都可以找我

http://www.twelife.com 台灣生活網
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
tuberose



註冊時間: 2006-05-02
文章: 33


第 6 樓

發表發表於: 星期三 六月 24, 2015 2:17 pm    文章主題: 引言回覆

主页找:http://vfpx.codeplex.com/
或者在:http://vfpx.codeplex.com/releases/view/106904
回頂端
檢視會員個人資料 發送私人訊息
ckp6250



註冊時間: 2004-07-30
文章: 1642


第 7 樓

發表發表於: 星期三 六月 24, 2015 8:50 pm    文章主題: 引言回覆

這個也是好貨
google chart api
簡單易用跨平台
若是新學製圖的話,最好不要花心思在vfp
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
ezpos



註冊時間: 2011-04-20
文章: 323


第 8 樓

發表發表於: 星期一 七月 06, 2015 4:14 pm    文章主題: 引言回覆

請問大大
為何 我編譯成 .exe執行檔案
統計圖表 是空白的

在vfp開發環境是正常的

_________________
ezPos收銀機 簡單好用低成本 http://www.ezpos.info
全新美觀的POS收銀機.POS軟硬體耗材.
軟體客制化.網站規劃....能賺錢的都可以找我

http://www.twelife.com 台灣生活網
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
Abel



註冊時間: 2005-03-14
文章: 189
來自: 鹿港小鎮

第 9 樓

發表發表於: 星期五 三月 15, 2019 3:09 pm    文章主題: 引言回覆

回覆 ezpos 大

整支程式開發完成後,移機至 User 電腦中有兩個注意要件
1. system.app 需隨程式分發,路徑置於 config.fpw檔 內的 DEFAULT 指定中 (預設路徑)
2. vfp9 RunTime檔 (程式所在執行路徑中) 一定要是 sp2 版本以上(含),如果是低版本會有兩種情形

a. 出現錯誤「 無效的 SYSTEM 成員 」
b. 程式雖然能執行,但是 主Form 中的「圖表」不會出現

以上是個人心得
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作