/// <summary> /// 初始化绘图底层 /// </summary> /// <param name="width"></param> /// <param name="height"></param> /// <param name="type"></param> /// <returns></returns> public static IRetroGraph InitGraph(int width, int height, eGraphType type) { IRetroGraph graph = null; if (type == eGraphType.Texture) { graph = TextureGraph.Create(width, height); } else { //TODO } return(graph); }
public FormPanelForHisto(List<cExtendedList> ListValues, bool IsStacked, eGraphType GraphType, eOrientation HistoOrientation) { InitializeComponent(); this.IsStacked = IsStacked; this.HistoOrientation = HistoOrientation; this.ListValues = ListValues; #region adapt the context menu if (this.ListValues.Count > 1) { ToolStripMenuItem_Stacked = new ToolStripMenuItem("Stacked"); ToolStripMenuItem_Stacked.CheckOnClick = true; ToolStripMenuItem_Stacked.Checked = IsStacked; ToolStripMenuItem_Stacked.Click += new System.EventHandler(this.ChangeStackedState); contextMenuStrip.Items.Add(ToolStripMenuItem_Stacked); } this.GraphType = GraphType; if (this.GraphType == eGraphType.HISTOGRAM) { ToolStripMenuItem_BinNumber = new ToolStripMenuItem("Bin Number"); // ToolStripMenuItem_Stacked.CheckOnClick = true; // ToolStripMenuItem_Stacked.Checked = IsStacked; ToolStripMenuItem_BinNumber.Click += new System.EventHandler(this.ChangeBinNumber); contextMenuStrip.Items.Add(ToolStripMenuItem_BinNumber); } #endregion CurrentChartArea = new ChartArea(); CurrentChartArea.BorderColor = Color.Black; this.chart.ChartAreas.Add(CurrentChartArea); this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDoubleClick); this.chart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.chart_MouseClick); RedrawHisto(); }
public void AddData(int series, int data, Color color, eGraphType graphType) { if (series >= dataCollection.Count) { dataCollection.Add(new GraphData(new List<int>(data), color, graphType)); } dataCollection[series].Color = color; dataCollection[series].Value.Add(data); if (dataCollection[series].Value.Count > history) { dataCollection[series].Value.RemoveRange(0, dataCollection[series].Value.Count - history); } updateData = true; }
public cPanelHisto(cExtendedList ListValues,eGraphType GraphType, eOrientation HistoOrientation) { WindowForPanelHisto = new FormPanelForHisto(new List<cExtendedList>(){ListValues}, false,GraphType, HistoOrientation); }
public FormPanelForHisto WindowForPanelHisto; // = new FormPanelForHisto(List<cExtendedList> ListValues); #endregion Fields #region Constructors public cPanelHisto(List<cExtendedList> ListValues, bool IsStacked, eGraphType GraphType, eOrientation HistoOrientation) { WindowForPanelHisto = new FormPanelForHisto(ListValues, IsStacked,GraphType, HistoOrientation); }