コード例 #1
0
ファイル: Form1.cs プロジェクト: ShenYhan/ShadowWinform
        /// <summary>
        /// 初始化速度曲线
        /// </summary>
        private void CreateVelocityChart()
        {
            //Create new _chartTemp

            _chartVelocity = new LightningChartUltimate();
            //Disable rendering, strongly recommended before updating chart properties
            _chartVelocity.BeginUpdate();

            //Reduce memory usage and increase performance. Destroys out-scrolled data.
            _chartVelocity.ViewXY.DropOldSeriesData = true;

            _chartVelocity.Parent      = lightningChartUltimate3;
            _chartVelocity.Name        = "Si prediction";
            _chartVelocity.Title.Text  = "铁水实时流速曲线";
            _chartVelocity.Title.Color = PublicColor.FromArgb(255, Color.Yellow);
            _chartVelocity.Title.Font  = new Font("黑体", 10, FontStyle.Bold);
            _chartVelocity.Dock        = DockStyle.Fill;

            // Setup custom style.
            //ExampleUtils.SetStandardFlatStyle(_chartSi);
            _chartVelocity.Background.Color        = PublicColor.FromArgb(255, Color.Gray);
            _chartVelocity.Background.GradientFill = GradientFill.Solid;
            //Configure x-axis
            AxisX xAxis = _chartVelocity.ViewXY.XAxes[0];

            xAxis.ValueType        = AxisValueType.DateTime;
            xAxis.Title.Text       = "Time";
            xAxis.AutoFormatLabels = false;
            //xAxis.LabelsTimeFormat = "dd/MM/yyyy\nHH:mm.ss";
            xAxis.LabelsTimeFormat = "HH:mm.ss";
            xAxis.LabelsAngle      = 0;
            xAxis.ScrollMode       = XAxisScrollMode.Scrolling;
            xAxis.LabelsFont       = new Font("黑体", 6);
            xAxis.LabelsColor      = PublicColor.FromArgb(255, Color.Yellow);
            xAxis.Visible          = false;
            xAxis.Title.Visible    = false;

            //Convert DateTime values to axis values
            DateTime now  = DateTime.Now;
            double   minX = xAxis.DateTimeToAxisValue(now);
            double   maxX = xAxis.DateTimeToAxisValue(now) + 200;

            xAxis.SetRange(minX, maxX);

            //Configure y-axis
            AxisY yAxis = _chartVelocity.ViewXY.YAxes[0];

            yAxis.Title.Text = "Si Predition";
            yAxis.SetRange(4.5, 8);
            yAxis.LabelsFont    = new Font("黑体", 6);
            yAxis.LabelsColor   = PublicColor.FromArgb(255, Color.Yellow);
            yAxis.Title.Visible = false;

            //Configure and add series to the chart
            PointLineSeries series = new PointLineSeries(_chartVelocity.ViewXY, xAxis, yAxis);

            series.LineStyle.Color  = Color.Yellow;
            series.MouseInteraction = false;
            _chartVelocity.ViewXY.PointLineSeries.Add(series);

            //Don't show legendbox
            _chartVelocity.ViewXY.LegendBoxes[0].Visible = false;

            //Allow chart rendering
            _chartVelocity.EndUpdate();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: ShenYhan/ShadowWinform
        /// <summary>
        /// 初始化温度曲线
        /// </summary>
        private void CreateTempChart()
        {
            //Create new _chartTemp
            _chartTemp = new LightningChartUltimate();
            _chartTemp.BeginUpdate();
            _chartTemp.ViewXY.DropOldSeriesData = true;

            _chartTemp.Parent = lightningChartUltimate1;
            _chartTemp.Name   = "出铁口铁水温度曲线";
            //_chartTemp.Title.Font.;
            _chartTemp.Title.Text  = "出铁口铁水温度曲线";
            _chartTemp.Title.Color = PublicColor.FromArgb(255, Color.Yellow);
            _chartTemp.Title.Font  = new Font("黑体", 10, FontStyle.Bold);
            //_chartTemp.Title.Visible = false;
            _chartTemp.Dock                    = DockStyle.Fill;
            _chartTemp.Background.Color        = PublicColor.FromArgb(255, Color.Gray);
            _chartTemp.Background.GradientFill = GradientFill.Solid;

            AxisX xAxis = _chartTemp.ViewXY.XAxes[0];

            xAxis.ValueType        = AxisValueType.DateTime;
            xAxis.Title.Text       = "Time";
            xAxis.AutoFormatLabels = false;

            //xAxis.LabelsTimeFormat = "dd/MM/yyyy\nHH:mm.ss";
            xAxis.LabelsTimeFormat = "HH:mm.ss";
            xAxis.LabelsAngle      = 0;
            xAxis.ScrollMode       = XAxisScrollMode.Scrolling;
            xAxis.Title.Visible    = false;
            xAxis.Visible          = false;

            //Convert DateTime values to axis values
            DateTime now  = DateTime.Now;
            double   minX = xAxis.DateTimeToAxisValue(now);
            double   maxX = xAxis.DateTimeToAxisValue(now) + 100;

            xAxis.SetRange(minX, maxX);

            //Configure y-axis
            AxisY yAxis = _chartTemp.ViewXY.YAxes[0];

            yAxis.Title.Text    = "Temperature / °C";
            yAxis.Title.Visible = false;
            yAxis.SetRange(1500, 1600);
            yAxis.LabelsFont  = new Font("黑体", 6);
            yAxis.LabelsColor = PublicColor.FromArgb(255, Color.Yellow);

            //Configure and add series to the chart
            PointLineSeries series = new PointLineSeries(_chartTemp.ViewXY, xAxis, yAxis);

            series.LineStyle.Color  = Color.Yellow;
            series.MouseInteraction = false;

            _chartTemp.ViewXY.PointLineSeries.Add(series);

            //Don't show legendbox
            _chartTemp.ViewXY.LegendBoxes[0].Visible = false;

            //Allow chart rendering
            _chartTemp.EndUpdate();
        }