ZedGraph的在線文檔
http://zedgraph.sourceforge.net/documentation/default.html
官網的源代碼 http://sourceforge.net/projects/zedgraph/?source=directory
zedgraph的demo在線范例
http://zedgraph.sourceforge.net/samples.html
這里介紹了如何實現動態加載數據,並且提供了demo
http://goorman.free.fr/ZedGraph/zedgraph.org/wiki/index3061.html?title=Display_Dynamic_or_Real-Time_Data
The ZedGraphControl can display dynamic or static data. For dynamic displays, each time you want to add data to a graph, you will need to do the following:
ZedGraph可以顯示動態或者靜態的數據,對於動態展示,每當你想要把數據加載到graph上的時候,你需要按照以下的步驟來做
1.Find the CurveItem of interest within the GraphPane.CurveList collection
第一步,先找到GraphPane.CurveList 中的相關曲線
2.Access the PointPairList (or other IPointListEdit type) for the CurveItem, and add the new data or modify the existing data as required
第二步,找到曲線中的PointPairList ,然后根據需要加載新數據或者修改已經存在的數據
3.Call ZedGraphControl.AxisChange() to update the auto-scaled axis ranges
第三步,調用ZedGraphControl的AxisChange()函數來更新坐標軸范圍的比例
4.Call Form.Invalidate() to update the graph
第四步,調用Form.Invalidate() 來更新graph------------[貌似我沒有找到這個方法,winform支持?]
The data points are stored with each CurveItem as a reference to an IPointList interface in CurveItem.Points. Note that this point list reference can be any class that implements IPointList. If it also implements IPointListEdit, thenIPointListEdit.Add() and IPointListEdit.RemoveAt() methods will be available.
The code sample is for a form that implements a ZedGraphControl with a Timer event to show dynamically updated data. You can download the complete project from the links below:
ZedGraph控件隨機生成曲線的顏色,以及X軸坐標文字豎着顯示==========mypane.XAxis.Scale.FontSpec.Angle = 270;//X軸的時間垂直顯示
http://blog.csdn.net/happy09li/article/details/7535388
ZedGraph使用大全http://www.cnblogs.com/peterzb/archive/2009/07/19/1526726.html
//zedgraph一些屬性的介紹
http://blog.chinaunix.net/uid-20776117-id-1847015.html
ZedGraph刷新數據的方法
zedGraphControl1.AxisChange();//此方法 調整坐標軸的范圍
Invalidate()//使控件的特定區域無效並向控件發送繪制消息。
//調用 Invalidate 方法並不強制同步繪制;若要強制同步繪制,請在調用 Invalidate 方法之后調用 Update 方法。 在不帶參數的情況下調用此方法時,會將整個工作區添加到更新區域。
zedGraphControl1.Invalidate();
zedGraphControl1.Update();
或者
zedGraphControl1.Refresh();//強制控件使其工作區無效並立即重繪自己和任何子控件。
//讓坐標軸不不顯示10^x;[這樣做會導致比例尺失調]
zedGraphControl1.GraphPane.XAxis.Type = AxisType.Log;
zedGraphControl1.GraphPane.XAxis.Scale.IsUseTenPower = false;
IsUseTenPower ->> 是否為10次冪表示,scale為LogScale時有效。 The powers-of-ten notation is just the text "10" followed by a superscripted value indicating the magnitude. This mode is only valid for log scales. boolean value; true to show the title as a power of ten, false to show a regular numeric value (e.g., "0.01", "10", "1000")
zedGraphControl1.GraphPane.XAxis.Title.IsOmitMag
zedGraphControl1.GraphPane.XAxis.Type = AxisType.Log;
給某一個曲線加載100萬點,希望橫軸顯示100000,200000,300000
直接設定好,坐標軸
zedGraphControl1.GraphPane.XAxis.Scale.Max = number;//設定X軸的最大值
zedGraphControl1.GraphPane.XAxis.Scale.MajorStep = number / 10;//設定最大步長
zedGraphControl1.GraphPane.XAxis.Scale.MinorStep = number / 10 / 5;//設定最小步長
zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Angle = 45;//設定X軸的字體的傾斜度
注意:一定不要調用zedGraphControl1.AxisChange();否則上面的設置就白設置了,相當於重置了

