本文整理匯總了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;
}
}