本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Chart.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.Invoke方法的具体用法?C# Chart.Invoke怎么用?C# Chart.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataVisualization.Charting.Chart
的用法示例。
在下文中一共展示了Chart.Invoke方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayChart
public void DisplayChart(Chart dchart)
{
if (dchart.Series.Count == 0)
{
var series = new Series("Chart")
{
ChartType = SeriesChartType.Line,
Color = System.Drawing.Color.MediumPurple,
BorderWidth = 2
};
MethodInvoker action = delegate { dchart.Series.Add(series); };
dchart.Invoke(action);
}
else
{
MethodInvoker action = delegate
{
dchart.Series[0].Points.AddXY(MaxDt.ToShortDateString(), Strategyperformance.EntireTradesSum);
dchart.Legends[0].Enabled = false;
};
dchart.Invoke(action);
}
}
示例2: PlotXYAppend
private void PlotXYAppend(Chart chart, Series dataSeries, double x, double y)
{
chart.Invoke(new PlotXYDelegate(dataSeries.Points.AddXY), new Object[] { x, y });
}
示例3: updateChart
void updateChart(Chart chart, int i, Double[] points)
{
if (chart.InvokeRequired)
{
chart.Invoke(new updateChartDelegate(updateChart), new object[] { chart, i, points });
}
else
{
if (chart.Series[i].Points.Count > 0)
chart.Series[i].Points.Clear();
for (int j = 0; j < points.Length; j++)
chart.Series[i].Points.Add(points[j]);
}
}
示例4: resetChart
void resetChart(Chart chart, int from, int to)
{
if (chart.InvokeRequired)
{
chart.Invoke(new resetChartDelegate(resetChart), new object[] { chart, from, to });
}
else
{
for (int j = from; j < to; j++)
chart.Series[j].Points.Clear();
}
}
示例5: point2Chart
private void point2Chart(PointD newPoint, Chart chartName)
{
if (chartName.InvokeRequired)
chartName.Invoke(new AddDataToChartDelegate(this.point2Chart), new object[] { newPoint, chartName });
else
{
chartName.Series["Series1"].Points.AddXY(newPoint.X, newPoint.Y);
if (chartName.Series["Series1"].Points.Count > pointsInChart)
{
chartName.Series["Series1"].Points.RemoveAt(0);
}
chartName.ChartAreas["ChartArea1"].AxisX.Minimum = chartName.Series["Series1"].Points[0].XValue;
chartName.ChartAreas["ChartArea1"].AxisX.Maximum = chartName.Series["Series1"].Points[chartName.Series["Series1"].Points.Count-1].XValue;
}
}