Visifire 使用指南:遇到400请求错误的解决方案与记录
...
private void CreateChart()
{
// Create a Chart element
Chart chart = new Chart();
// Set chart width and height
chart.Width = 400;
chart.Height = 300;
// Create new DataSeries
DataSeries dataSeries = new DataSeries();
// Number of DataPoints to be generated
int numberOfDataPoints = 10;
// To set the YValues of DataPoint
Random random = new Random();
// Loop and add a few DataPoints
for (int loopIndex = 0; loopIndex < numberOfDataPoints; loopIndex++)
{
// Create a DataPoint
DataPoint dataPoint = new DataPoint();
// Set the YValue using random number
dataPoint.YValue = random.Next(1, 100);
// Add DataPoint to DataSeries
dataSeries.DataPoints.Add(dataPoint);
}
// Add DataSeries to Chart
chart.Series.Add(dataSeries);
// Add chart to the LayoutRoot for display
LayoutRoot.Children.Add(chart);
}