首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> C語言 >> 關於C語言

ZedGraph 基礎教程 (3) - DemoBase 結構、屬性與構造函數初始化

     編輯:關於C語言

DemoBase 類別結構

InitialSampleDemo → DemoBase → ZedGraphDemo(介面)

  • ZedGraphDemo 介面定義:Description、Title、ZedGraphControl、Types 四屬性。
  • DemoBase 實作介面,並新增 PaneBase Pane、MasterPane MasterPane 兩屬性,提供多載構造函數。

構造函數初始化流程

public InitialSampleDemo() : base("Code Project Initial Sample", "Initial Sample", DemoType.Tutorial)

基類四個多載構造函數最終呼叫私有 Init 方法:

private void Init(string description, string title, ICollection types) {
    this.description = description;
    this.title = title;
    this.types = types;
    control = new ZedGraphControl();
}

圖表標題設定

myPane.Title = "My Test Graph\n(For CodeProject Sample)";
myPane.XAxis.Title = "My X Axis";
myPane.YAxis.Title = "My Y Axis";

對應圖示中的標題區域。

資料點集合與正弦波生成

同前節,使用 PointPairList 填充 36 個點的正弦波資料。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved