public void SetSeriesStyle(int seriesIndex, GraphStyle style) { if (seriesIndex >= 0 && seriesIndex < this.SeriesList.Count) { SeriesFormatParams format = this.SeriesList[seriesIndex].Format; format.Style = style; this.SeriesList[seriesIndex].Format = format; } }
/// <summary> /// 初始化波形控件 /// </summary> /// <param name="mode">初始化模式</param> public void f_InitMode(GraphStyle mode) { switch (mode) { case GraphStyle.AutoMode: _isAutoModeXY = true; _isDefaultMoveModeXY = false; break; case GraphStyle.DefaultMoveMode: _isAutoModeXY = false; _isDefaultMoveModeXY = true; break; case GraphStyle.None: _isAutoModeXY = false; _isDefaultMoveModeXY = false; break; default: break; } Refresh(); }
/// <summary> /// Displays/updates a horizontal bar graph. /// </summary> /// <param name="index"> /// The graph index to use. /// </param> /// <param name="style"> /// The graph style to use. /// </param> /// <param name="startCol"> /// The starting column for the graph (0 - 15). /// </param> /// <param name="endCol"> /// The ending column for the graph (0 - 15). /// </param> /// <param name="len"> /// The graph bar length (should be a value between startCol and endCol). /// </param> /// <param name="row"> /// The row to place the bar graph in (0 or 1). /// </param> public void SetBarGraph(GraphIndices index, GraphStyle style, UInt16 startCol, UInt16 endCol, UInt16 len, UInt16 row) { // Make sure start and end columns are valid. Also make sure the row is legit. if (startCol < 0) { startCol = 0; } if (endCol < 0) { endCol = 0; } if (row < 0) { row = 0; } switch (this._type) { case DisplayType.SixteenByTwo: if (startCol > 15) { startCol = 15; } if (endCol > 15) { endCol = 15; } if (row > 1) { row = 1; } break; case DisplayType.TwentyByFour: if (startCol > 19) { startCol = 19; } if (endCol > 19) { endCol = 19; } if (row > 3) { row = 3; } break; } if (endCol <= startCol) { throw new IndexOutOfRangeException("End column must be greater than start column."); } // Create the command buffer with all params. Byte[] buf = new Byte[7]; buf[0] = (Byte)CFCommand.CFHorizontalBarGraph; buf[1] = (Byte)index; buf[2] = (Byte)style; buf[3] = (Byte)startCol; buf[4] = (Byte)endCol; buf[5] = (Byte)len; buf[6] = (Byte)row; // Send the command and destroy the buffer. this.SendCommand(buf); Array.Clear(buf, 0, buf.Length); }
public SeriesFormatParams(string name, GraphStyle style, Color32 color) { this.Name = name; this.Style = style; this.PrimaryColor = color; }
public int AddSeries(string name, System.Func <float> sampleCallback, Color color, GraphStyle style) { Series series = new Series(name, style, color); series.AutoSampleCallback = sampleCallback; int index = this.SeriesList.Count; this.SeriesList.Add(series); UnityEngine.Debug.Assert(index == this.SeriesList.Count - 1); return(index); }
public int AddSeries(string name, System.Func <float> sampleCallback, GraphStyle style = GraphStyle.Line) { return(AddSeries(name, sampleCallback, this.Format.NextAutoColor, style)); }
public int AddSeries(string name, GraphStyle style = GraphStyle.Line) { return(AddSeries(name, null, style)); }
/// <summary> /// Creates a graph with a specific color. Returns null if /// SAGO_DEBUG is not set. /// </summary> /// <param name="seriesName">Series name.</param> /// <param name="sampleCallback">Sample callback.</param> /// <param name="color">Color.</param> /// <param name="style">Style.</param> /// <param name="maxSamples">Max samples.</param> public static Graph Create(string seriesName, System.Func <float> sampleCallback, Color color, GraphStyle style = GraphStyle.Line, int maxSamples = DefaultMaxSamples) { #if SAGO_DEBUG Graph newDebugGraph = Create(seriesName, sampleCallback, style, maxSamples); newDebugGraph.SetSeriesColor(0, color); return(newDebugGraph); #else return(null); #endif }
/// <summary> /// Creates a graph object, which will call the given sampleCallback /// for data each frame. Returns null if SAGO_DEBUG is not /// set. /// </summary> /// <param name="seriesName">Series name.</param> /// <param name="sampleCallback">Sample callback.</param> /// <param name="style">Style.</param> /// <param name="maxSamples">Max samples.</param> public static Graph Create(string seriesName, System.Func <float> sampleCallback, GraphStyle style = GraphStyle.Line, int maxSamples = DefaultMaxSamples) { #if SAGO_DEBUG GameObject go = new GameObject(string.Format("Graph {0}", seriesName)); Graph newDebugGraph = go.AddComponent <Graph>(); string xAxisName, title; if (sampleCallback == null) { xAxisName = ""; title = seriesName; } else { xAxisName = "Time"; title = string.Format("{0} vs {1}", seriesName, xAxisName); } newDebugGraph.Init(title, xAxisName, seriesName, maxSamples); newDebugGraph.AddSeries(seriesName, sampleCallback, style); return(newDebugGraph); #else return(null); #endif }
/// <summary> /// Creates a graph object. Use the AddPoint() method on the /// returned value to add points. Returns null if SAGO_DEBUG /// is not set. /// </summary> /// <param name="seriesName">Series name.</param> /// <param name="style">Style.</param> /// <param name="maxSamples">Max samples.</param> public static Graph Create(string seriesName, GraphStyle style = GraphStyle.Line, int maxSamples = DefaultMaxSamples) { return(Create(seriesName, null, style, maxSamples)); }
public Series(string name, GraphStyle style, Color32 color) : this() { this.Format = new SeriesFormatParams(name, style, color); }
public DataVector(GraphStyle graphStyle, string name, SolidColorBrush myBrush) { this.myGraphStyle = graphStyle; this.name = name; this.MyBrush = myBrush; }
public DataVector(GraphStyle graphStyle, string name) { this.myGraphStyle = graphStyle; this.name = name; }