/// <summary> /// Set the following settings /// </summary> /// <param name="aPtCount">Set PointCount</param> /// <param name="aMinCoordinate">Set MinCoordinate</param> /// <param name="aMaxCoordinate">Set MaxCoordinate</param> /// <param name="aTitle">Title of the chart form</param> /// <param name="aMode">Mode which will be used for updating values</param> /// <param name="aTimerInterval">If mode is set to "Timed", the chart will be updated every given milliseconds</param> public FormChart(int aPtCount, double aMinCoordinate, double aMaxCoordinate, string aTitle, ChartUpdatingMode aMode, int aTimerInterval) { InitializeComponent(); // That is needed for smoothing the dynamic chart SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); PointCount = aPtCount; MinCoordinate = aMinCoordinate; MaxCoordinate = aMaxCoordinate; Text = aTitle; AutoCheckBoundaries = true; UpdatingMode = aMode; TimerInterval = aTimerInterval; chartCoordinates.ChartAreas["Coordinates"].AxisX.Minimum = 1; chartCoordinates.ChartAreas["Coordinates"].AxisX.Maximum = aPtCount; chartCoordinates.ChartAreas["Coordinates"].AxisX.Interval = 2; chartCoordinates.ChartAreas["Coordinates"].AxisX.Title = "Frame"; chartCoordinates.ChartAreas["Coordinates"].AxisY.Title = "Coordinate"; // That strip indicates the Zero value on Y axis with 2 pixels width StripLine stripLine = new StripLine(); stripLine.BackColor = Color.Black; stripLine.IntervalOffset = 0; stripLine.Interval = 0; stripLine.BorderColor = Color.Black; stripLine.BorderWidth = 2; // in pixels chartCoordinates.ChartAreas["Coordinates"].AxisY.StripLines.Add(stripLine); }
/// <summary> /// Set the following settings, remaining are set to default /// </summary> /// <param name="aPtCount">Set PointCount</param> /// <param name="aMinCoordinate">Set MinCoordinate</param> /// <param name="aMaxCoordinate">Set MaxCoordinate</param> /// <param name="aTitle">Title of the chart form</param> /// <param name="aMode">Mode which will be used for updating values</param> public FormChart(int aPtCount, double aMinCoordinate, double aMaxCoordinate, string aTitle, ChartUpdatingMode aMode) : this(aPtCount, aMinCoordinate, aMaxCoordinate, aTitle, aMode, 100) { }