public virtual string GetName(XYColumnPlotItemLabelTextStyle style) { int st = (int)style; int sx = st & 0x0F; int sy = (st & 0xF0) >> 4; System.Text.StringBuilder stb = new System.Text.StringBuilder(); if (sx > 0) { stb.Append(_plotData.GetXName(sx - 1)); if (sx > 0 && sy > 0) { stb.Append("(X)"); } if (sy > 0) { stb.Append(","); } } if (sy > 0) { stb.Append(_plotData.GetYName(sy - 1)); if (sx > 0 && sy > 0) { stb.Append("(Y)"); } } return(stb.ToString()); }
public override string GetName(string style) { XYColumnPlotItemLabelTextStyle result = XYColumnPlotItemLabelTextStyle.YS; try { result = (XYColumnPlotItemLabelTextStyle)Enum.Parse(typeof(XYColumnPlotItemLabelTextStyle), style, true); } catch (Exception) { } return(GetName(result)); }
private string GetName(object obj) { string result = string.Empty; // first of all, retrieve the actual name var mylayer = obj as HostLayer; if (null == mylayer) return result; var layer = mylayer as XYPlotLayer; if (_layerNumber >= 0 && mylayer.SiblingLayers != null && _layerNumber < mylayer.SiblingLayers.Count) layer = mylayer.SiblingLayers[_layerNumber] as XYPlotLayer; if (null == layer) return result; IGPlotItem pa = null; if (_plotNumber < layer.PlotItems.Flattened.Length) { pa = layer.PlotItems.Flattened[_plotNumber]; } if (pa != null) { result = pa.GetName(0); if (_plotLabelStyle != null && !_plotLabelStyleIsPropColName && pa is XYColumnPlotItem) { XYColumnPlotItemLabelTextStyle style = XYColumnPlotItemLabelTextStyle.YS; try { style = (XYColumnPlotItemLabelTextStyle)Enum.Parse(typeof(XYColumnPlotItemLabelTextStyle), _plotLabelStyle, true); } catch (Exception) { } result = ((XYColumnPlotItem)pa).GetName(style); } if (_plotLabelStyleIsPropColName && _plotLabelStyle != null && pa is XYColumnPlotItem) { XYColumnPlotData pb = ((XYColumnPlotItem)pa).Data; Data.DataTable tbl = null; if (pb.YColumn is Data.DataColumn) tbl = Data.DataTable.GetParentDataTableOf((Data.DataColumn)pb.YColumn); if (tbl != null) { int colNumber = tbl.DataColumns.GetColumnNumber((Data.DataColumn)pb.YColumn); if (tbl.PropertyColumns.ContainsColumn(_plotLabelStyle)) result = tbl.PropertyColumns[_plotLabelStyle][colNumber].ToString(); } } } return result; }
public virtual string GetName(XYColumnPlotItemLabelTextStyle style) { int st = (int)style; int sx = st & 0x0F; int sy = (st & 0xF0) >> 4; System.Text.StringBuilder stb = new System.Text.StringBuilder(); if (sx > 0) { stb.Append(_plotData.GetXName(sx - 1)); if (sx > 0 && sy > 0) stb.Append("(X)"); if (sy > 0) stb.Append(","); } if (sy > 0) { stb.Append(_plotData.GetYName(sy - 1)); if (sx > 0 && sy > 0) stb.Append("(Y)"); } return stb.ToString(); }