OxyPlot公共屬性一覽

一、PlotModel

1、構造函數中設置的屬性

public PlotModel()
{
    this.Axes = new ElementCollection(this);              //座標軸集合;
    this.Series = new ElementCollection(this);            //線條集合;
    this.Annotations = new ElementCollection(this);       //註解;
    this.Legends = new ElementCollection(this);           //圖例;
    this.PlotType = PlotType.XY;                          //座標系類型;


    this.PlotMargins = new OxyThickness(double.NaN);    //外邊距
    this.Padding = new OxyThickness(8);                 //內邊距


    this.Background = OxyColors.Undefined;              //圖表背景
    this.PlotAreaBackground = OxyColors.Undefined;      //圖表區域背景


    this.TextColor = OxyColors.Black;                   //圖表內的字體顏色(標題、圖例、註解、座標軸)
    this.TitleColor = OxyColors.Automatic;              //標題字體顏色
    this.SubtitleColor = OxyColors.Automatic;           //子標題字體顏色


    this.DefaultFont = "Segoe UI";                      //默認字體
    this.DefaultFontSize = 12;                          //默認字體大小


    this.TitleToolTip = null;                           //標題提示
    this.TitleFont = null;                              //標題字體
    this.TitleFontSize = 18;                            //標題字體大小
    this.TitleFontWeight = FontWeights.Bold;            //標題字重
    this.SubtitleFont = null;                           //子標題字體
    this.SubtitleFontSize = 14;                         //子標題字體大小
    this.SubtitleFontWeight = FontWeights.Normal;       //子標題字重
    this.TitlePadding = 6;                              //標題內邊距
    this.ClipTitle = true;                              //是否裁剪標題
    this.TitleClippingLength = 0.9;                     //標題裁剪矩形長度


    this.PlotAreaBorderColor = OxyColors.Black;             //圖表區域邊框顏色
    this.PlotAreaBorderThickness = new OxyThickness(1);     //圖表區域邊框大小
    this.EdgeRenderingMode = EdgeRenderingMode.Automatic;   //邊角渲染模式


    this.AssignColorsToInvisibleSeries = true;              //是否自動分配顏色給不可見的線條
    this.IsLegendVisible = true;                            //圖例是否可見(要使用圖例則必須設置線條標題)
    //默認顏色集合
    this.DefaultColors = new List                 
    {
            OxyColor.FromRgb(0x4E, 0x9A, 0x06),
            OxyColor.FromRgb(0xC8, 0x8D, 0x00),
            OxyColor.FromRgb(0xCC, 0x00, 0x00),
            OxyColor.FromRgb(0x20, 0x4A, 0x87),
            OxyColors.Red,
            OxyColors.Orange,
            OxyColors.Yellow,
            OxyColors.Green,
            OxyColors.Blue,
            OxyColors.Indigo,
            OxyColors.Violet
    };


    this.AxisTierDistance = 4.0;                            //座標軸刻度距離
}

其他屬性

RenderingDecorator  //渲染裝飾器
Subtitle            //子標題
Title               //標題
TitleHorizontalAlignment    //標題和子標題的水平對齊方式

只讀屬性

ActualPlotMargins   //實際圖表邊距
PlotView            //圖表視圖
PlotBounds          //圖表邊界
Width ​              //圖表寬
Height              //圖表高
PlotAndAxisArea     //包含圖表和座標軸的區域
PlotArea            //圖表區(不包含座標軸和圖例)
TitleArea           //標題區域
DefaultAngleAxis        //默認角軸
DefaultMagnitudeAxis    //默認級軸
DefaultXAxis            //默認X軸
DefaultYAxis            //默認Y軸
DefaultColorAxis        //默認顏色軸

二、Axis

1、構造函數中設置的屬性

protected Axis()
{
    this.Position = AxisPosition.Left;              //座標軸位置
    this.PositionTier = 0;                          //座標軸離圖表的距離
    this.IsAxisVisible = true;                      //座標軸是否顯示
    this.Layer = AxisLayer.BelowSeries;             //座標軸層級


    this.ViewMaximum = double.NaN;                  //視圖最大值(用於縮放和平移時)
    this.ViewMinimum = double.NaN;                  //視圖最小值


    this.AbsoluteMaximum = double.MaxValue;         //座標軸絕對最大值(數據值範圍)(不可縮放和平移超出此限制)
    this.AbsoluteMinimum = double.MinValue;         //座標軸絕對最小值


    this.Minimum = double.NaN;                      //座標軸固定範圍最小值
    this.Maximum = double.NaN;                      //座標軸固定範圍最大值
    this.MinorStep = double.NaN;                    //輔刻度線間隔
    this.MajorStep = double.NaN;                    //主刻度線間隔
    this.MinimumMinorStep = 0;                      //輔刻度線間隔最小值
    this.MinimumMajorStep = 0;                      //主刻度線間隔最小值


    this.MinimumPadding = 0.01;                     //最小值額外空間(0.01表示1%)(設置了Minimum則此處無效)
    this.MaximumPadding = 0.01;                     //最大值額外空間
    this.MinimumRange = 0;                          //最小範圍(ActualMaximum-ActualMinimum > MinimumRange)
    this.MaximumRange = double.PositiveInfinity;    //最大範圍(ActualMaximum-ActualMinimum < MinimumRange)
    this.MinimumDataMargin = 0;                     //最小值的屏幕空間數據邊距
    this.MaximumDataMargin = 0;                     //最大值的屏幕空間數據邊距
    this.MinimumMargin = 0;                         //最小值的屏幕空間邊距
    this.MaximumMargin = 0;                         //最大值的屏幕空間邊距


    this.TickStyle = TickStyle.Outside;             //刻度樣式
    this.TicklineColor = OxyColors.Black;           //刻度線顏色
    this.MinorTicklineColor = OxyColors.Automatic;  //輔刻度線顏色


    this.AxislineStyle = LineStyle.None;            //座標軸線樣式
    this.AxislineColor = OxyColors.Black;           //座標軸線顏色
    this.AxislineThickness = 1.0;                   //座標軸線粗細


    this.MajorGridlineStyle = LineStyle.None;                               //主網格線樣式
    this.MajorGridlineColor = OxyColor.FromArgb(0x40, 0, 0, 0);             //主網格線顏色
    this.MajorGridlineThickness = 1;                                        //主網格線粗細


    this.MinorGridlineStyle = LineStyle.None;                               //輔網格線樣式
    this.MinorGridlineColor = OxyColor.FromArgb(0x20, 0, 0, 0x00);          //輔網格線顏色
    this.MinorGridlineThickness = 1;                                        //輔網格線粗細


    this.ExtraGridlineStyle = LineStyle.Solid;                              //額外網格線樣式
    this.ExtraGridlineColor = OxyColors.Black;                              //額外網格線顏色
    this.ExtraGridlineThickness = 1;                                        //額外網格線粗細


    this.MinorTickSize = 4;                         //輔刻度大小
    this.MajorTickSize = 7;                         //主刻度大小


    this.StartPosition = 0;                         //座標軸在圖表區的起點(0-1)
    this.EndPosition = 1;                           //座標軸在圖表區的終點(0-1)


    this.TitlePosition = 0.5;                       //標題位置(0-1)
    this.TitleFormatString = "{0} [{1}]";           //標題格式化字符串(0代表Title,1代表Unit)
    this.TitleClippingLength = 0.9;                 //標題長度(0-1)
    this.TitleColor = OxyColors.Automatic;          //標題顏色
    this.TitleFontSize = double.NaN;                //標題字體大小
    this.TitleFontWeight = FontWeights.Normal;      //標題字重
    this.ClipTitle = true;                          //是否截斷標題


    this.Angle = 0;                                 //座標軸標籤角度


    this.IsZoomEnabled = true;                      //是否允許縮放
    this.IsPanEnabled = true;                       //是否允許平移


    this.FilterMinValue = double.MinValue;          //可顯示的最小值(小等於該值將不會顯示)
    this.FilterMaxValue = double.MaxValue;          //可顯示的最大值(大等於該值將不會顯示)
    this.FilterFunction = null;                     //過濾方法


    this.IntervalLength = 60;                       //主刻度劃分份數


    this.AxisDistance = 0;                          //座標軸和圖表的距離
    this.AxisTitleDistance = 4;                     //座標軸標題和標籤的距離
    this.AxisTickToLabelDistance = 4;               //座標軸刻度和標籤的距離


    this.DataMaximum = double.NaN;                  //數據最大值
    this.DataMinimum = double.NaN;                  //數據最小值
}

2、其它屬性

CropGridlines           //是否在開始和結束位置裁切與座標軸垂直的網格線
ExtraGridlines          //額外的網格線
Key                     //座標軸的鍵
LabelFormatter          //標籤格式化方法
PositionAtZeroCrossing  //是否放置在相關座標的零交點
StringFormat            //格式化字符串
Title                   //座標軸標題
TitleFont               //標題字體
Unit                    //單位
UseSuperExponentialFormat   //是否使用上標指數格式

3、只讀屬性

ActualMajorStep         //實際主步長
ActualMaximum           //實際最大值
ActualMinimum           //實際最小值
ClipMaximum             //已顯示的最大值(由ActualMaximum和MaximumDataMargin決定)
ClipMinimum             //已顯示的最小值(由ActualMinimum和MinimumDataMargin決定)
ActualMinorStep         //實際輔步長
ActualStringFormat      //實際被使用的格式字符串
ActualTitle             //實際標題
IsReversed              //是否被反轉(StartPosition > EndPosition)
Offset                  //偏移(用於在數據和屏幕座標間轉換)
Scale                   //比例因子(用於在數據和屏幕座標間轉換的換算係數)
ScreenMax               //最大端的屏幕座標
ScreenMin               //最小端的屏幕座標
DesiredMargin           //期望邊距

三、Series

Background          //背景色
IsVisible           //是否可見
Title               //標題
LegendKey           //對應的圖例的鍵
SeriesGroupName     //分組名稱
RenderInLegend      //是否在圖例中顯示
TrackerFormatString //Tracker格式化字符串
TrackerKey          //對應的Tracker的鍵

四、LegendBase

Key                 //鍵
IsLegendVisible     //是否可見
LegendOrientation   //圖例的方向(如果圖例被放在圖表的左邊或者右邊,水平方向會轉爲垂直方向)
LegendPadding       //圖例內邊距
LegendSymbolLength  //圖例標誌的長度(默認16)
LegendSymbolMargin  //圖例標誌外邊距(標誌和文字的距離)
LegendSymbolPlacement   //圖例標誌位置
LegendTitle             //圖例標題
LegendTitleColor        //圖例標題顏色
LegendTitleFont         //圖例標題字體
LegendTitleFontSize     //圖例標題字體大小
LegendTitleFontWeight   //圖例標題字重
LegendArea              //圖例區域
LegendSize              //圖例尺寸
LegendBackground        //圖例背景色
LegendBorder            //圖例邊框色
LegendBorderThickness   //圖例邊框粗細
LegendColumnSpacing     //圖例列的間距(只針對垂直方向)
LegendFont              //圖例字體
LegendFontSize          //圖例字體大小
LegendTextColor         //圖例字體顏色
LegendFontWeight        //圖例字體字重
LegendItemAlignment     //圖例項對齊方式
LegendItemOrder         //圖例項排序
LegendItemSpacing       //水平排列時圖例項的空間
LegendLineSpacing       //圖例項垂直間距
LegendMargin            //圖例外邊距
LegendMaxWidth          //圖例最大寬度
LegendMaxHeight         //圖例最大高度
LegendPlacement         //圖例擺放位置(內和外)
LegendPosition          //圖例位置
AllowUseFullExtent      //圖例放在外面時是否允許使用圖表的完整extent
ShowInvisibleSeries     //是否顯示不可見的序列數據的圖例

五、Annotation

Layer               //註解渲染層(默認爲AboveSeries)
XAxis               //X軸
XAxisKey            //X軸的鍵
YAxis               //Y軸
YAxisKey            //Y軸的鍵
ClipByXAxis         //是否由X軸範圍裁剪
ClipByYAxis         //是否由Y軸範圍裁剪

原文

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章