Verweise geändert

This commit is contained in:
Husky
2018-07-08 19:06:58 +02:00
parent b49b7f1654
commit 942c61b323
5 changed files with 43 additions and 48 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -28,41 +28,25 @@
/// </summary>
private void InitializeComponent()
{
this.chartControl1 = new Syncfusion.Windows.Forms.Chart.ChartControl();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// chartControl1
// button1
//
this.chartControl1.ChartArea.CursorLocation = new System.Drawing.Point(0, 0);
this.chartControl1.ChartArea.CursorReDraw = false;
this.chartControl1.EnableYZooming = true;
this.chartControl1.IsWindowLess = false;
//
//
//
this.chartControl1.Legend.Location = new System.Drawing.Point(485, 75);
this.chartControl1.Localize = null;
this.chartControl1.Location = new System.Drawing.Point(12, 12);
this.chartControl1.MinZoomFactorX = 0.5D;
this.chartControl1.MinZoomFactorY = 0.5D;
this.chartControl1.Name = "chartControl1";
this.chartControl1.PrimaryXAxis.LogLabelsDisplayMode = Syncfusion.Windows.Forms.Chart.LogLabelsDisplayMode.Default;
this.chartControl1.PrimaryXAxis.Margin = true;
this.chartControl1.PrimaryYAxis.LogLabelsDisplayMode = Syncfusion.Windows.Forms.Chart.LogLabelsDisplayMode.Default;
this.chartControl1.PrimaryYAxis.Margin = true;
this.chartControl1.Size = new System.Drawing.Size(776, 357);
this.chartControl1.TabIndex = 0;
//
//
//
this.chartControl1.Title.Name = "Default";
this.button1.Location = new System.Drawing.Point(90, 67);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(210, 112);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FrmLinerChart
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.chartControl1);
this.Controls.Add(this.button1);
this.Name = "FrmLinerChart";
this.Text = "FrmLinerChart";
this.ResumeLayout(false);
@@ -71,6 +55,6 @@
#endregion
private Syncfusion.Windows.Forms.Chart.ChartControl chartControl1;
private System.Windows.Forms.Button button1;
}
}

View File

@@ -17,18 +17,24 @@ namespace SanSystem
public FrmLinerChart()
{
InitializeComponent();
ChartAxis axis = chartControl1.PrimaryYAxis;
}
public void SaveChart()
{
Size size = new Size(800, 400);
ChartControl chartControl = new ChartControl();
chartControl.Size = size;
ChartAxis axis = chartControl.PrimaryYAxis;
ChartAxis axis0 = new ChartAxis(ChartOrientation.Vertical);
ChartAxis axis1 = new ChartAxis(ChartOrientation.Vertical);
ChartAxisLayout layout1 = new ChartAxisLayout();
ChartAxisLayout layout2 = new ChartAxisLayout();
chartControl1.Axes.Add(axis0);
chartControl1.Axes.Add(axis1);
chartControl.Axes.Add(axis0);
chartControl.Axes.Add(axis1);
layout1.Spacing = 12;
layout2.Spacing = 12;
@@ -36,8 +42,8 @@ namespace SanSystem
layout2.Axes.Add(axis0);
layout2.Axes.Add(axis1);
chartControl1.ChartArea.YLayouts.Add(layout1);
chartControl1.ChartArea.YLayouts.Add(layout2);
chartControl.ChartArea.YLayouts.Add(layout1);
chartControl.ChartArea.YLayouts.Add(layout2);
ChartSeries temperaturChart = new ChartSeries("Temperatur", ChartSeriesType.Line);
ChartSeries druckChart = new ChartSeries("Druck", ChartSeriesType.Line);
@@ -65,10 +71,10 @@ namespace SanSystem
axis0.Title = "[bar]";
axis0.TitleFont = new Font("Segeo UI", 14F);
chartControl1.LegendsPlacement = ChartPlacement.Outside;
chartControl1.LegendPosition = ChartDock.Bottom;
chartControl1.LegendAlignment = ChartAlignment.Center;
chartControl1.Title.Visible = false;
chartControl.LegendsPlacement = ChartPlacement.Outside;
chartControl.LegendPosition = ChartDock.Bottom;
chartControl.LegendAlignment = ChartAlignment.Center;
chartControl.Title.Visible = false;
ChartAxis chartAxis = new ChartAxis();
chartAxis.Orientation = ChartOrientation.Horizontal;
@@ -76,11 +82,11 @@ namespace SanSystem
chartAxis.DrawGrid = false;
chartAxis.LineType.Width = 1F;
chartAxis.LineType.ForeColor = Color.Black;
chartControl1.Axes.Add(chartAxis);
chartControl.Axes.Add(chartAxis);
chartControl1.Series.Add(temperaturChart);
chartControl1.Series.Add(druckChart);
chartControl1.Skins = Skins.Metro;
chartControl.Series.Add(temperaturChart);
chartControl.Series.Add(druckChart);
chartControl.Skins = Skins.Metro;
axis1.OpposedPosition = true;
@@ -88,7 +94,12 @@ namespace SanSystem
axis0.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
axis1.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
chartControl1.SaveImage("./temp.jpg");
chartControl.SaveImage("./temp.jpg");
}
private void button1_Click(object sender, EventArgs e)
{
SaveChart();
}
}
}