本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Chart.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.Update方法的具体用法?C# Chart.Update怎么用?C# Chart.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataVisualization.Charting.Chart
的用法示例。
在下文中一共展示了Chart.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneratePlot
public string GeneratePlot(double[] items, string title)
{
string file = "";
chart = new Chart();
chart.ChartAreas.Add(new ChartArea());
int i = 1;
foreach (var item in items)
{
SetChart(title, i, item);
i++;
}
DateTime d = DateTime.Now;
var xxx = String.Format("{0}_{1}_{2}_{3}_{4}_{5}_{6}", d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond);
String chartFilename = Common.Folder.Data + "\\" + xxx + ".bmp";
chart.Update();
chart.SaveImage(chartFilename, System.Drawing.Imaging.ImageFormat.Bmp);
file = chartFilename;
return file;
}
示例2: GetChart
public Chart GetChart()
{
if (ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber() == 1) return null;
Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
//CurrentSeries.ShadowOffset = 2;
for (int IdxValue = 0; IdxValue < ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber(); IdxValue++)
CurrentSeries.Points.Add(ListDescriptors[CurrentDescriptorToDisplay].Getvalue(IdxValue));
ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);
CurrentChartArea.BorderColor = Color.White;
Chart ChartToReturn = new Chart();
ChartToReturn.ChartAreas.Add(CurrentChartArea);
// ChartToReturn.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
CurrentChartArea.BackColor = Color.White;
CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;
CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
// CurrentChartArea.Axes[0].Title = ListDescriptors[CurrentDescriptorToDisplay].GetName();
CurrentSeries.ChartType = SeriesChartType.Line;
CurrentSeries.Color = Color.Black;
// CurrentSeries.BorderWidth = 3;
CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY;
CurrentSeries.Name = "Series" + PosX + "x" + PosY;
ChartToReturn.Series.Add(CurrentSeries);
Title CurrentTitle = new Title(PosX + "x" + PosY);
// ChartToReturn.Titles.Add(CurrentTitle);
ChartToReturn.Width = 100;
ChartToReturn.Height = 48;
ChartToReturn.Update();
// ChartToReturn.Show();
return ChartToReturn;
}
示例3: Marker
//=============================================================
private void Marker(Chart ch, int SerNum, int PointNum, int opt)
{
int serlen;
switch (opt)
{
case 0://change
ch.Series[SerNum].Points[PointNum].MarkerStyle = MarkerStyle.Cross;
ch.Series[SerNum].Points[PointNum].MarkerSize = 5;
ch.Series[SerNum].Points[PointNum].MarkerColor = System.Drawing.Color.Red;
ch.Update();
break;
case 1://restore point
ch.Series[SerNum].Points[PointNum].MarkerStyle = ch.Series[SerNum].MarkerStyle;
ch.Series[SerNum].Points[PointNum].MarkerSize = ch.Series[SerNum].MarkerSize;
ch.Series[SerNum].Points[PointNum].MarkerColor = ch.Series[SerNum].MarkerColor;
ch.Update();
break;
case 2://restore series ?????????????
serlen = ch.Series[SerNum].Points.Count;
for (int i = 0; i < serlen; i++)
{
if (ch.Series[SerNum].Points[i].MarkerStyle != ch.Series[SerNum].MarkerStyle)
ch.Series[SerNum].Points[i].MarkerStyle = ch.Series[SerNum].MarkerStyle;
if (ch.Series[SerNum].Points[i].MarkerSize != ch.Series[SerNum].MarkerSize)
ch.Series[SerNum].Points[i].MarkerSize = ch.Series[SerNum].MarkerSize;
if (ch.Series[SerNum].Points[i].MarkerColor != ch.Series[SerNum].MarkerColor)
ch.Series[SerNum].Points[i].MarkerColor = ch.Series[SerNum].MarkerColor;
}
ch.Update();
break;
default:
break;
}
}