本文整理汇总了C#中Visifire.Charts.DataPoint类的典型用法代码示例。如果您正苦于以下问题:C# DataPoint类的具体用法?C# DataPoint怎么用?C# DataPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataPoint类属于Visifire.Charts命名空间,在下文中一共展示了DataPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ImportLineData
public void ImportLineData(ArrayList values1, ArrayList values2)
{
dsc = new DataSeriesCollection();
DataSeries ds1 = new DataSeries();
ds1.RenderAs = RenderAs.Line;
ds1.LegendText = "ObjValue";
for (int i = 0; i < values1.Count; i = i + 4)
{
DataPoint dp = new DataPoint();
dp.YValue = (double)values1[i];
dp.XValue = i;
ds1.DataPoints.Add(dp);
}
DataSeries ds2 = new DataSeries();
ds2.RenderAs = RenderAs.Line;
ds2.LegendText = "Variance";
for (int i = 0; i < values2.Count; i = i + 4)
{
DataPoint dp = new DataPoint();
dp.YValue = (double)values2[i];
dp.XValue = i;
ds2.DataPoints.Add(dp);
}
dsc.Add(ds1);
dsc.Add(ds2);
}
开发者ID:silibili,项目名称:Clustering-Algorithm-in-csharp,代码行数:28,代码来源:ChartHelper.cs
示例2: TestDateTimeWithSingleDataPoint
public void TestDateTimeWithSingleDataPoint()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
TestPanel.Children.Add(chart);
EnqueueConditional(() => { return _isLoaded; });
EnqueueDelay(_sleepTime);
EnqueueCallback(() =>
{
DataSeries dataSeries = new DataSeries();
DataPoint dataPoint = new DataPoint();
dataPoint.XValue = new DateTime(2009, 1, 1);
dataPoint.YValue = rand.Next(10, 100);
dataSeries.DataPoints.Add(dataPoint);
chart.Series.Add(dataSeries);
});
EnqueueCallback(() =>
{
Assert.AreEqual(1, chart.Series[0].DataPoints.Count);
});
EnqueueDelay(_sleepTime);
EnqueueTestComplete();
}
开发者ID:zhangzy0193,项目名称:visifire,代码行数:35,代码来源:DateTimeAxisTest.cs
示例3: TestDateTimeWithSingleDataPoint
public void TestDateTimeWithSingleDataPoint()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
DataSeries dataSeries = new DataSeries();
DataPoint dataPoint = new DataPoint();
dataPoint.XValue = new DateTime(2009, 1, 1);
dataPoint.YValue = rand.Next(10, 100);
dataSeries.DataPoints.Add(dataPoint);
chart.Series.Add(dataSeries);
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
Assert.AreEqual(1, chart.Series[0].DataPoints.Count);
window.Dispatcher.InvokeShutdown();
window.Close();
}
}
开发者ID:tdhieu,项目名称:openvss,代码行数:29,代码来源:DateTimeAxisTest.cs
示例4: barGraph_Click
//柱状图
private void barGraph_Click(object sender, RoutedEventArgs e)
{
graphContainer.Children.Clear();
Chart chart = new Chart();
chart.Watermark = false;
chart.View3D = true;
chart.Width = 300;
chart.Height = 200;
Title title = new Title();
title.Text = "人口类别统计图";
chart.Titles.Add(title);
for (int i = 0; i < 8; i++)
{
DataSeries dataSeries = new DataSeries();
dataSeries.ShowInLegend = false;
dataSeries.RenderAs = RenderAs.Column;
for (int loopIndex = 0; loopIndex < 3; loopIndex++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.AxisXLabel = pop[loopIndex];
dataPoint.YValue = points[i, loopIndex];
dataSeries.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries);
}
//将柱状图添加到 Grid 控件以固定位置
graphContainer.VerticalAlignment = VerticalAlignment.Top;
graphContainer.HorizontalAlignment = HorizontalAlignment.Left;
graphContainer.Children.Add(chart);
}
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:31,代码来源:ThemeGraph.xaml.cs
示例5: NetSyn_Mydata
void NetSyn_Mydata(DataStruct msg)
{
int packagenumber = msg.trafficRate;
double rate = packagenumber * 472.0 * 8.0 / 5000.0;
DataPoint dataPoint = new DataPoint();
dataPoint.YValue = rate;
FullFigure.DataPoints.Add(dataPoint);
}
开发者ID:Tripmaster-zhang,项目名称:Hello_World,代码行数:8,代码来源:TrafficRateFullFigure.xaml.cs
示例6: CreateLcChartSpline
private void CreateLcChartSpline(int index)
{
//添加横坐标
if (lcChart.AxesX.Count == 0)
{
Axis xAxis = new Axis();
xAxis.Title = "岩层编号";
lcChart.AxesX.Add(xAxis);
}
//添加纵坐标
if (lcChart.AxesY.Count == 0)
{
Axis yAxis = new Axis();
yAxis.Title = LCDestOpt[index];
yAxis.IntervalType = IntervalTypes.Number;
yAxis.ValueFormatString = "f3";
yAxis.Suffix = "m";
lcChart.AxesY.Add(yAxis);
}
else
{
lcChart.AxesY[0].Title = LCDestOpt[index];
}
//设置数据点
lcDataSeries.DataPoints.Clear();
DataPoint dataPoint;
int drawCount = keyLayers.Count;
for (int i = 0; i < drawCount; i++)
{
//创建一个数据点的实例
dataPoint = new DataPoint();
//设置X轴点
dataPoint.AxisXLabel = keyLayers[i].ycbh.ToString();
dataPoint.XValue = i + 1;
//设置Y轴点
switch(index)
{
case 0:
dataPoint.YValue = keyLayers[i].yczdxcz;
break;
case 1:
dataPoint.YValue = keyLayers[i].jsdjscjwy;
break;
case 2:
dataPoint.YValue = keyLayers[i].jsdjslcwy;
break;
}
dataPoint.MarkerSize = 8;
dataPoint.MouseLeftButtonDown += new MouseButtonEventHandler(lcdataPoint_MouseLeftButtonDown);
//添加数据点
lcDataSeries.DataPoints.Add(dataPoint);
}
}
开发者ID:meikeyuan,项目名称:main,代码行数:56,代码来源:Document.offsetlc.cs
示例7: AddDataToDataSerise
public static void AddDataToDataSerise(DataSeries ds,List<double> list)
{
double allCount = 100;
double value = allCount / list.Count;
for (int i = 0; i < list.Count; i++)
{
DataPoint dp = new DataPoint() { YValue = System.Math.Abs(list[i]) * 0.1, XValue = i * value };
ds.DataPoints.Add(dp);
}
}
开发者ID:dewade2003,项目名称:DSJL,代码行数:10,代码来源:DataSeriseUtil.cs
示例8: GetDataPointCollection
public static DataPointCollection GetDataPointCollection( List<double> list)
{
DataPointCollection dpc = new DataPointCollection();
double allCount = 100;
double value = allCount / list.Count;
for (int i = 0; i < list.Count; i++)
{
DataPoint dp = new DataPoint() { YValue = System.Math.Abs(list[i]) * 0.1, XValue = i * value };
dpc.Add(dp);
}
return dpc;
}
开发者ID:dewade2003,项目名称:DSJL,代码行数:12,代码来源:DataSeriseUtil.cs
示例9: ColumnChartPerformanceTest
public void ColumnChartPerformanceTest()
{
Double totalDuration = 0;
DateTime start = DateTime.UtcNow;
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
chart.View3D = false;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Axis axisX = new Axis();
axisX.Interval = 1;
chart.AxesX.Add(axisX);
Random rand = new Random();
Int32 numberOfSeries = 0;
DataSeries dataSeries = null;
Int32 numberofDataPoint = 0;
String msg = Common.AssertAverageDuration(100, 1, delegate
{
dataSeries = new DataSeries();
dataSeries.RenderAs = RenderAs.Column;
for (Int32 i = 0; i < 1000; i++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.AxisXLabel = "a" + i;
dataPoint.YValue = rand.Next(-100, 100);
dataSeries.DataPoints.Add(dataPoint);
numberofDataPoint++;
}
numberOfSeries++;
chart.Series.Add(dataSeries);
});
window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
DateTime end = DateTime.UtcNow;
totalDuration = (end - start).TotalSeconds;
MessageBox.Show("Total Chart Loading Time: " + totalDuration + "s" + "\n" + "Number of Render Count: " + chart.ChartArea._renderCount + "\n" + "Series Calculation: " + msg);
}
window.Dispatcher.InvokeShutdown();
}
开发者ID:tdhieu,项目名称:openvss,代码行数:52,代码来源:PerformanceTests.cs
示例10: TestDataPointPropertyChanged
public void TestDataPointPropertyChanged()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
TestPanel.Children.Add(chart);
EnqueueConditional(() => { return _isLoaded; });
EnqueueDelay(_sleepTime);
DataSeries dataSeries = new DataSeries();
DataPoint dataPoint = null;
for (Int32 i = 0; i < 10; i++)
{
dataPoint = new DataPoint();
dataPoint.XValue = i + 1;
dataPoint.YValue = rand.Next(10, 100);
dataPoint.PropertyChanged += delegate(Object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
Assert.IsNotNull(e.PropertyName);
if (e.PropertyName == "XValue")
Assert.AreEqual("XValue", e.PropertyName);
else if (e.PropertyName == "YValue")
Assert.AreEqual("YValue", e.PropertyName);
else
Assert.IsNotNull(e.PropertyName);
};
dataSeries.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries);
EnqueueCallback(() =>
{
dataPoint.XValue = 10;
dataPoint.YValue = rand.Next(-100, 100);
});
EnqueueDelay(_sleepTime);
EnqueueTestComplete();
}
开发者ID:tdhieu,项目名称:openvss,代码行数:51,代码来源:DataPointTest.cs
示例11: SetChartData
private void SetChartData(DataTable dt,string strname, string linecolor)
{
Visifire.Charts.DataSeries dataSeries = new Visifire.Charts.DataSeries();
AddDataSeries(strname, dataSeries, LineStyles.Solid, new SolidColorBrush((Color)ColorConverter.ConvertFromString(linecolor)), Visifire.Charts.RenderAs.QuickLine);
for (int i = 0; i < dt.Rows.Count; i++)
{
Visifire.Charts.DataPoint dataPoint = new DataPoint();
dataPoint.AxisXLabel = dt.Rows[i]["time"].ToString();
dataPoint.Color = new SolidColorBrush(Colors.Blue);
dataPoint.YValue = Convert.ToDouble(dt.Rows[i]["value"]);
dataPoint.Tag = " ";
dataSeries.DataPoints.Add(dataPoint);
}
this.chartC.Series.Add(dataSeries);
}
开发者ID:UEChip,项目名称:UENSimulation,代码行数:15,代码来源:ChartLineYearUC.xaml.cs
示例12: TestDataPointPropertyChanged
public void TestDataPointPropertyChanged()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
DataSeries dataSeries = new DataSeries();
DataPoint dataPoint = null;
for (Int32 i = 0; i < 10; i++)
{
dataPoint = new DataPoint();
dataPoint.XValue = i + 1;
dataPoint.YValue = rand.Next(10, 100);
dataPoint.PropertyChanged += delegate(Object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
Assert.IsNotNull(e.PropertyName);
if (e.PropertyName == "XValue")
Assert.AreEqual("XValue", e.PropertyName);
else
Assert.AreEqual("YValue", e.PropertyName);
};
dataSeries.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries);
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
dataPoint.XValue = 10;
dataPoint.YValue = rand.Next(-100, 100);
}
window.Dispatcher.InvokeShutdown();
window.Close();
}
开发者ID:zhangzy0193,项目名称:visifire,代码行数:46,代码来源:DataPointTest.cs
示例13: CreateChart
/// <summary>
/// Function to create a chart
/// </summary>
public void CreateChart()
{
// Create a new instance of Chart
Chart chart = new Chart();
// Set the chart width and height
//chart.Width = 500;
//chart.Height = 300;
// Create a new instance of Title
Title title = new Title();
// Set title property
title.Text = "Visifire Sample Chart";
// Add title to Titles collection
chart.Titles.Add(title);
// Create a new instance of DataSeries
DataSeries dataSeries = new DataSeries();
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Column;
// Create a DataPoint
DataPoint dataPoint;
for (int i = 0; i < 5; i++) {
// Create a new instance of DataPoint
dataPoint = new DataPoint();
// Set YValue for a DataPoint
dataPoint.YValue = rand.Next(10, 100);
// Add dataPoint to DataPoints collection
dataSeries.DataPoints.Add(dataPoint);
}
// Add dataSeries to Series collection.
chart.Series.Add(dataSeries);
// Add chart to LayoutRoot
LayoutRoot.Children.Add(chart);
}
开发者ID:beginor,项目名称:AssemblyNavigation,代码行数:47,代码来源:ChartPage.xaml.cs
示例14: Bubble3D1
public Bubble3D1()
{
InitializeComponent();
Chart chart = new Chart();
// Create a new instance of Title
Title title = new Title();
// Set title property
title.Text = "Election Result";
// Add title to Titles collection
chart.Titles.Add(title);
DataPoint dataPoint;
PhoneApplicationService.Current.State["GetTopEarnerList"] = GetDataByStatesJSONRequest.dataList;
getDataList = (List<DataByState>)PhoneApplicationService.Current.State["GetTopEarnerList"];
DataSeries dataSeries = new DataSeries();
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Bubble;
for (int i = 0; i < getDataList.Count; i++)
{
// Create a new instance of DataPoint
dataPoint = new DataPoint();
// Set YValue for a DataPoint
dataPoint.YValue = Convert.ToDouble(getDataList[i].votes);
dataPoint.AxisXLabel = getDataList[i].party;
// Add dataPoint to DataPoints collection.
dataSeries.DataPoints.Add(dataPoint);
}
// Add dataSeries to Series collection.
chart.Series.Add(dataSeries);
// Add chart to LayoutRoot
LayoutRoot.Children.Add(chart);
}
开发者ID:jagan27101986,项目名称:WP7,代码行数:42,代码来源:Bubble3D1.xaml.cs
示例15: EarningByCategories
public void EarningByCategories(string data)
{
var categories = Deserializes(data);
var chart = new Chart {Width = 500, Height = 300, View3D = true};
chart.Titles.Add(new Title {Text = "Thu nhập theo danh mục"});
var dataSeries = new DataSeries {RenderAs = RenderAs.Doughnut};
foreach (var category in categories)
{
var dataPoint = new DataPoint
{
YValue = category.Earnings,
AxisXLabel = category.Name,
};
dataSeries.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries);
LayoutRoot.Children.Clear();
LayoutRoot.Children.Add(chart);
}
开发者ID:preguntoncojonero,项目名称:mylifevn,代码行数:21,代码来源:Page.xaml.cs
示例16: CreateChart
/// <summary>
/// Function to create a chart
/// </summary>
public void CreateChart()
{
// Create a new instance of Chart
chart = new Chart();
chart.Watermark = false;
// Create a new instance of DataSeries
DataSeries dataSeries = new DataSeries();
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Line;
dataSeries.LineStyle = LineStyles.Solid;
dataSeries.LineThickness = 3;
dataSeries.LabelEnabled = false;
// Create a DataPoint
DataPoint dataPoint;
for (int i = 0; i < 10; i++)
{
// Create a new instance of DataPoint
dataPoint = new DataPoint();
// Set YValue for a DataPoint
dataPoint.YValue = rand.Next(-100, 100);
// Add dataPoint to DataPoints collection
dataSeries.DataPoints.Add(dataPoint);
}
// Add dataSeries to Series collection.
chart.Series.Add(dataSeries);
// Attach a Loaded event to chart in order to attach a timer's Tick event
chart.Loaded += new RoutedEventHandler(chart_Loaded);
// Add chart to Chart Grid
ChartGrid.Children.Add(chart);
}
开发者ID:Lashway,项目名称:owsnp,代码行数:43,代码来源:Window1.xaml.cs
示例17: ExpenseByCategories
public void ExpenseByCategories(string data)
{
var categories = Deserializes(data);
var chart = new Chart {Width = 500, Height = 300, View3D = true};
chart.Titles.Add(new Title {Text = "Chi tiêu theo danh mục"});
var dataSeries = new DataSeries {RenderAs = RenderAs.Doughnut};
foreach (var category in categories)
{
var dataPoint = new DataPoint
{
YValue = Math.Abs(category.Expenses),
AxisXLabel = category.Name,
//Color = BuildBrush(category.ColorHex)
};
dataSeries.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries);
LayoutRoot.Children.Clear();
LayoutRoot.Children.Add(chart);
}
开发者ID:preguntoncojonero,项目名称:mylifevn,代码行数:22,代码来源:Page.xaml.cs
示例18: DataSeriesColumnChecking
public void DataSeriesColumnChecking()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
chart.View3D = true;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
DataSeries dataSeries1 = new DataSeries();
dataSeries1.RenderAs = RenderAs.Column;
Int32 numberOfDataPoints = 0;
Common.AssertAverageDuration(300, 1,
delegate
{
for (Int32 i = 0; i < 100; i++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.XValue = i + 1;
dataPoint.YValue = rand.Next(-500, 500);
dataSeries1.DataPoints.Add(dataPoint);
numberOfDataPoints++;
}
chart.Series.Add(dataSeries1);
});
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
window.Dispatcher.InvokeShutdown();
window.Close();
}
}
开发者ID:tdhieu,项目名称:openvss,代码行数:39,代码来源:DataSeriesTest.cs
示例19: NetSyn_Mydata
void NetSyn_Mydata(DataStruct msg)
{
//int packagenumber = msg.trafficRate;//*******************
if (msg.cpudet == 1)
trafficRate_odd = msg.trafficRate;
else
trafficRate_even = msg.trafficRate;
packagenumber = trafficRate_even + trafficRate_odd;
double rate = packagenumber * 448.0 * 8.0 * 1000000.0 / 7 / 600.0 / 1024 / 1024 / 1024;//该公式待修改。**************************
currentRate.Content = ((int)(rate*1000))/1000.0;//待修改~~等待数据过来完全无问题后可用于直接显示吞吐量。
CurRate.Text = "The Last One Minute Throughput (一分钟内的吞吐量) Cur(当前速率):" + ((int)(rate*1000))/1000.0 + "Gbps";
DataPoint dataPoint = new DataPoint();
dataPoint.YValue = rate;
Realtime.DataPoints.Add(dataPoint);
while (Realtime.DataPoints.Count > numbertoshow)
{
Realtime.DataPoints.Remove(Realtime.DataPoints[0]);
}
}
开发者ID:Tripmaster-zhang,项目名称:Hello_World,代码行数:22,代码来源:TrafficRateRealtime.xaml.cs
示例20: Draw
/// <summary>
/// Metodo de graficación.
/// </summary>
/// <returns></returns>
public Chart Draw(params string[] filtros)
{
// Create a new instance of Chart
Chart chart = new Chart();
chart.AnimationEnabled = true;
// Create a new instance of Title
Title title = new Title();
// Set title property
title.Text = "Efectividad MDZ";
// Add title to Titles collection
chart.Titles.Add(title);
// Create a new instance of DataSeries
DataSeries dataSeries = new DataSeries();
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Line;
#region configuracion eje X
// Creating AxisX
Axis axisX = new Axis();
// Date time standard format
axisX.ValueFormatString = "000000";
// To avoid auto skip
chart.AxesX.Add(axisX);
#endregion
// Create a DataPoint
DataPoint dataPoint;
#region consulta
DataTable kpis;
try
{
kpis = new DataTable();
Consultas consulta = new Consultas();
kpis = consulta.SelectKPI_EfectividadMDZ(filtros).Tables[0];
consulta = null;
string serAnt = "-5555";
string ser = "-1111";
foreach (DataRow g in kpis.Rows)
{
Decimal? y = g["EfectivenessByBrand"]!=DBNull.Value?(Decimal?)g["EfectivenessByBrand"]:null;
long x = (long)g["TimeId"];
ser = (string)g["ProductSubfamilyDescription"];
//Creando las series
if (serAnt != ser)
{
if (serAnt != "-5555")
{
chart.Series.Add(dataSeries);
}
// Create a new instance of DataSeries
dataSeries = new DataSeries();
dataSeries.Name = ser;
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Line;
dataSeries.MarkerType = Visifire.Commons.MarkerTypes.Circle;
dataSeries.SelectionEnabled = true;
dataSeries.LineThickness = 3;
}
// Create a new instance of DataPoint
dataPoint = new DataPoint();
// Set YValue for a DataPoint
if (x != null) dataPoint.AxisXLabel = x.ToString();
if (!ciclos.Contains(x.ToString())) ciclos.Add(x.ToString());
dataPoint.YValue = System.Convert.ToDouble(y);
// Add dataPoint to DataPoints collection.
dataSeries.DataPoints.Add(dataPoint);
serAnt = ser;
}
}
catch (Exception Error)
{
throw (new Exception(Error.ToString()));
}
#endregion
// Add dataSeries to Series collection.
chart.Series.Add(dataSeries);
return chart;
}
开发者ID:slytsal,项目名称:nmtmdz,代码行数:83,代码来源:EfectividadMDZ.cs
注:本文中的Visifire.Charts.DataPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论