本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.DataPoint类的典型用法代码示例。如果您正苦于以下问题:C# DataPoint类的具体用法?C# DataPoint怎么用?C# DataPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataPoint类属于System.Windows.Forms.DataVisualization.Charting命名空间,在下文中一共展示了DataPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateNamedPoint
public static DataPoint CreateNamedPoint(string name, double x, double y)
{
DataPoint pnt = new DataPoint(x, y);
pnt.Label = name;
return pnt;
}
开发者ID:n0la,项目名称:dclog,代码行数:7,代码来源:ChartHelper.cs
示例2: getData_Click
private void getData_Click(object sender, EventArgs ea)
{
gradesChart.Series.Clear();
output.Write(1);
var grades = new System.Windows.Forms.DataVisualization.Charting.Series
{
Name = "Grade",
Color = System.Drawing.Color.CornflowerBlue,
IsVisibleInLegend = true,
IsXValueIndexed = true,
ChartType = SeriesChartType.Bar,
XValueType = ChartValueType.String,
YValueType = ChartValueType.Double
};
gradesChart.Series.Add(grades);
var numEntries = input.ReadInt32();
for (int i = 0; i < numEntries; i++)
{
var name = input.ReadString();
var grade = input.ReadDouble();
var point = new DataPoint();
point.SetValueXY(name, new object[] { grade + 1.0 });
grades.Points.Add(point);
}
}
开发者ID:hogeschool,项目名称:INFDEV02-3,代码行数:27,代码来源:DataVisualisation.cs
示例3: phodiemthi_Load
private void phodiemthi_Load(object sender, EventArgs e)
{
dataGridView1.Hide();
dbVeMTDataContext db = new dbVeMTDataContext();
dataGridView1.Rows.Clear();
var results = from p in db.vemts
group p by p.diem into g
select new { diem = g.Key , soluong = g.Count() };
dataGridView1.DataSource = results;
db.SubmitChanges();
//Tìm và đặt giá trị MAX cho trục Y
int max = Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value);
for (int i = 1; i <= dataGridView1.SelectedRows.Count; i++)
if (max < Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value))
max = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value);
if (chart1.ChartAreas[0].AxisY.Maximum < max) chart1.ChartAreas[0].AxisY.Maximum = max;
chart1.Series.Clear();
Series s = new Series();
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
s.ChartType = SeriesChartType.Line;
DataPoint p = new DataPoint();
p.XValue = i;
p.SetValueY(Convert.ToDouble(dataGridView1.Rows[i].Cells[1].Value));
//p.AxisLabel = "Điểm " + dataGridView1.Rows[i].Cells[0].Value.ToString() +"";
p.AxisLabel = "điểm" + i.ToString(); ;
s.Points.Add(p);
}
chart1.Series.Add(s);
}
开发者ID:hokhacnam,项目名称:DATN,代码行数:32,代码来源:phodiemthi.cs
示例4: CreateDataPoint
private static DataPoint CreateDataPoint(double x, string axisLabel, DateTime start, DateTime end, string text, Color color) {
var point = new DataPoint(x, new double[] { start.ToOADate(), end.ToOADate() });
point.Color = color;
point.Label = text;
point.AxisLabel = axisLabel;
return point;
}
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:GanttChart.cs
示例5: GraphWindow
public GraphWindow(IDictionary<string, decimal> incomes, IDictionary<string, decimal> expenses)
{
InitializeComponent();
labMonth.Visible = false;
btnNext.Visible = false;
btnPrev.Visible = false;
chart.Series.Clear();
Series s = new Series("Money");
chart.Legends.Clear();
s.Color = Color.Green;
foreach (var i in incomes)
{
var dp = new DataPoint(0, (double)i.Value);
dp.Name = i.Key;
dp.AxisLabel = i.Key;
dp.Color = Color.Green;
s.Points.Add(dp);
}
foreach (var i in expenses)
{
var dp = new DataPoint(0, (double)i.Value);
dp.Name = i.Key;
dp.AxisLabel = i.Key;
dp.Color = Color.DarkRed;
s.Points.Add(dp);
}
chart.Series.Add(s);
SetupChartArea();
chart.DataBind();
}
开发者ID:jomarko,项目名称:FinanceManager,代码行数:32,代码来源:GraphWindow.cs
示例6: MitPie
public MitPie(int miID, int akPro)
{
InitializeComponent();
this.MinimumSize = new Size(300, 300);
this.MaximumSize = new Size(800, 500);
chart1.Size = new Size(this.Width - 10, this.Height - 10);
DataTable arbeiter = SqlConnection.SelectStatement("SELECT prName,sum( zeDauer ) as sum,miName,miVorname FROM tzeiterfassung LEFT JOIN tProjekt using (prID) LEFT JOIN tMitarbeiter using (miID) WHERE miID =" + miID + " GROUP BY prID");
DataTableReader reader = arbeiter.CreateDataReader();
Series a = chart1.Series[0];
if (reader.HasRows)
{
while (reader.Read())
{
DataPoint p = new DataPoint();
p.SetValueY(Convert.ToDouble(reader["sum"].ToString()));
p.AxisLabel = reader["prName"].ToString();
p.IsValueShownAsLabel = true;
a.Points.Add(p);
}
Mitarbeiter.Text = reader["miVorname"].ToString() + " " + reader["miName"].ToString();
}
}
开发者ID:Gasbuddel,项目名称:Zeiterfassungsprojekt,代码行数:26,代码来源:MitPie.cs
示例7: FragmentDataDisplay
public FragmentDataDisplay(XRayDisplays xrayDisplays)
{
InitializeComponent();
CultureResources.registerDataProvider(this);
m_XrayImageDisplay = xrayDisplays;
//============ lisview settings
_TypeCollection.Add("Not Specified");
_TypeCollection.Add("Metal");
_TypeCollection.Add("Organic");
_TypeCollection.Add("Inorganic");
_ShapeCollection.Add("Not Specified");
_ShapeCollection.Add("Cylindical");
_ShapeCollection.Add("Rectangular");
_ShapeCollection.Add("C Shape");
_SizeCollection.Add("Not Specified");
_SizeCollection.Add(" < 4 mm");
_SizeCollection.Add("5mm-8mm");
_SizeCollection.Add("9mm-12mm");
_SizeCollection.Add("13mm-16mm");
_SizeCollection.Add("17mm-20mm");
_SizeCollection.Add(">20mm");
for (int i = 0; i < 99; i++)
{
DataPoint dp = new DataPoint(i + 1, 0);
UniformityChartSeries.Points.Add(dp);
}
}
开发者ID:BdGL3,项目名称:CXPortal,代码行数:32,代码来源:FragmentDataDisplay.xaml.cs
示例8: MainWindow
public MainWindow()
{
InitializeComponent();
phone_book_root_node = tv_PhoneBook.Nodes["phone_book_root_node"];
sessions_root_node = tv_Sessions.Nodes["sessions_root_node"];
internal_root_node = sessions_root_node.Nodes["internal_root_node"];
external_root_node = sessions_root_node.Nodes["external_root_node"];
inbound_root_node = sessions_root_node.Nodes["inbound_root_node"];
outbound_root_node = sessions_root_node.Nodes["outbound_root_node"];
sessions_root_node.ExpandAll();
talk_duration_less_than_a_minute = new DataPoint { Name = "LessThenAMinute", LegendText = "Talk < 1 min", YValues = new[] { 0.0 }, Color = Color.FromArgb(100, 180, 100) };
c_UserChart.Series[USER_STATES].Points.Add(talk_duration_less_than_a_minute);
talk_duration_over_a_minute = new DataPoint { Name = "OverAMinute", LegendText = "Talk >= 1 min", YValues = new[] { 0.0 }, Color = Color.FromArgb(180, 80, 80) };
c_UserChart.Series[USER_STATES].Points.Add(talk_duration_over_a_minute);
SetState(LoginState.LoggedOut);
presenter = new MainWindowPresenter(this, SimpleIOCContainer.Instance.Resolve<IOPSClient>());
c_Statistics.Series[NUMBER_OF_SESSIONS].Points.AddXY(0, 0);
c_Statistics.Series[NUMBER_OF_DROPPED_SESSIONS].Points.AddXY(0, 0);
presenter.Connect();
t_Timer.Start();
}
开发者ID:B-Rich,项目名称:Ozeki-Call-Center-Manager,代码行数:28,代码来源:MainWindow.cs
示例9: createSampleChart
private void createSampleChart()
{
barChart.ChartAreas.Clear();
barChart.ChartAreas.Add("area1");
ChartArea chartArea = barChart.ChartAreas[0];
chartArea.AxisX.MajorGrid.Enabled = false;
chartArea.AxisY.MajorGrid.Enabled = false;
chartArea.AxisY.Minimum = 0;
chartArea.AxisY.Maximum = 1;
barChart.Series.Clear();
barChart.Series.Add("matches");
Series series = barChart.Series[0];
series.ChartType = SeriesChartType.Column;
series.ChartArea = barChart.ChartAreas[0].Name;
int x = 1;
DataPoint pt = new DataPoint(series);
pt.XValue = x;
x++;
pt.YValues = new double[] { .75 };
pt.AxisLabel = "phrase 1";
series.Points.Add(pt);
pt.BorderColor = System.Drawing.Color.Black;
int r = 255 - (int)(pt.YValues[0] * 255.0);
pt.Color = System.Drawing.Color.FromArgb(r, r, r);
pt = new DataPoint(series);
pt.XValue = x;
x++;
pt.YValues = new double[] { .5 };
pt.AxisLabel = "phrase 2";
series.Points.Add(pt);
pt.BorderColor = System.Drawing.Color.Black;
r = 255 - (int)(pt.YValues[0] * 255.0);
pt.Color = System.Drawing.Color.FromArgb(r, r, r);
}
开发者ID:ewhitmire,项目名称:mypack-speech,代码行数:35,代码来源:PhraseChart.xaml.cs
示例10: changeChartType
public static void changeChartType(this Chart chart,SeriesChartType ChartType)
{
DataPoint[] points = new DataPoint[chart.Series.Count];
if (ChartType == SeriesChartType.Pie)
{
int i = 0;
foreach (var serie in chart.Series)
{
points[i] = serie.Points.FirstOrDefault();
i++;
}
chart.Series.Clear();
var newSerie = chart.Series.Add("Total");
newSerie.ChartType = ChartType;
foreach (var point in points)
{
newSerie.Points.Add(point);
}
return;
}
foreach (var serie in chart.Series)
{
serie.ChartType = ChartType;
}
}
开发者ID:mariomixtegapach,项目名称:ScrumRepo,代码行数:30,代码来源:Analitycs.cs
示例11: NewTemp
public void NewTemp(string msg)
{
string[] datum = msg.Split(',');
label1.Text = msg;
if (datum.Length > 5)
{
_lastAmbient = double.Parse(datum[1]);
DataPoint dp = new DataPoint(double.Parse(datum[0]), _lastAmbient);
Chart1.Series["Ambient"].Points.Add(dp);
_lastT1 = double.Parse(datum[2]);
dp = new DataPoint(double.Parse(datum[0]), _lastT1);
Chart1.Series["T0"].Points.Add(dp);
_lastT2 = double.Parse(datum[4]);
dp = new DataPoint(double.Parse(datum[0]), _lastT2);
Chart1.Series["T1"].Points.Add(dp);
if (_showLast50 && Chart1.Series["Ambient"].Points.Count > 50)
{
Chart1.ChartAreas[0].AxisX.ScaleView.Position = Chart1.Series["Ambient"].Points.Count - 50;
Chart1.ChartAreas[0].AxisX.ScaleView.Size = 50;
}
else
{
Chart1.ChartAreas[0].AxisX.ScaleView.ZoomReset();
}
_httpServer.Temps = new double[] { _lastAmbient, _lastT1, _lastT2 };
}
}
开发者ID:skthumperd,项目名称:SharpTemp,代码行数:28,代码来源:Form1.cs
示例12: InterpolateAll
public DataPoint[] InterpolateAll(DataPoint[] points, double start, double end)
{
DataPoint[] interpolatedPoints = new DataPoint[Data.ScreenViewSteps];
for(var n = 0; n < Data.ScreenViewSteps; n++) {
var x = start + n*(end - start)/Data.ScreenViewSteps;
var res = points[0].YValues[0];
for(var i = 1; i < points.Length; i++) {
double f = 0;
for(var j = 0; j <= i; j++) {
double den = 1;
for(var k = 0; k <= i; k++) {
if(k != j) {
den *= (points[j].XValue - points[k].XValue);
}
}
f += points[j].YValues[0]/den;
}
for(var k = 0; k < i; k++) {
f *= (x - points[k].XValue);
}
res += f;
}
interpolatedPoints[n] = new DataPoint(x, res);
}
return interpolatedPoints;
}
开发者ID:adduxa,项目名称:compMath,代码行数:26,代码来源:NewtonInterpolation.cs
示例13: MarkUtils
public MarkUtils()
{
InitializeComponent();
foreach (string s in Data.classes)
{
comboBox_classes.Items.Add(s);
Series series = new Series();
series.LegendText = s;
series.ChartType = SeriesChartType.Line;
series.YValueType = ChartValueType.String;
int i = 0;
foreach (Mark m in Data.marks)
{
if (m._class == s)
{
DataPoint dp = new DataPoint();
dp.XValue = i;
dp.YValues = new double[] { m.mark };
dp.Label = m.name;
series.Points.Add(dp);
}
}
chart_marks.Series.Add(series);
}
comboBox_classes.SelectedIndex = 0;
}
开发者ID:Jenjen1324,项目名称:SchuelerOffice,代码行数:27,代码来源:MarkUtils.cs
示例14: HandleDisplay
/// <summary>
/// Handles the display
/// </summary>
/// <param name="maxDistance"></param>
/// <param name="minDistance"></param>
/// <param name="height"></param>
protected override void HandleDisplay(double maxDistance, double minDistance, double height)
{
PointFunction pointFunction = Function as PointFunction;
if (pointFunction != null)
{
Data.ChartType = SeriesChartType.Point;
if (GraphVisualizer.RecordPreviousValuesInTsm)
{
DisplayPreviousData(maxDistance);
}
if (pointFunction.Point != null && !double.IsNaN(pointFunction.Point.Distance))
{
AddPoint(new DataPoint(pointFunction.Point.Distance, pointFunction.Point.Speed));
}
else if (pointFunction.SimulatedValues.Count != 0)
{
Data.ChartType = SeriesChartType.Line;
DataPoint dataPoint;
foreach (SpeedDistanceProfile profile in pointFunction.SimulatedValues)
{
dataPoint = new DataPoint(0, 0);
dataPoint.IsEmpty = true;
AddPoint(dataPoint);
foreach (SpeedDistancePoint point in profile.Points)
{
dataPoint = new DataPoint(point.Distance, point.Speed);
AddPoint(dataPoint);
}
}
}
}
}
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:38,代码来源:PointFunctionGraph.cs
示例15: IsIntersect
/// <summary>
/// Checks to see if two lines intersect
/// Line 1 is defined by series1_Point1 and series1_Point2
/// Line 2 is defined by series2_Point1 and series2_Point2
/// </summary>
/// <param name="series1_Point1">line's start point for series 1</param>
/// <param name="series1_Point2">line's end point for series 1</param>
/// <param name="series2_Point1">line's start point for series 2</param>
/// <param name="series2_Point2">line's end point for series 2</param>
/// <returns>DataPoint of where the lines intersect, null otherwise</returns>
public static DataPoint IsIntersect(DataPoint series1_Point1, DataPoint series1_Point2, DataPoint series2_Point1, DataPoint series2_Point2)
{
//find the slope of series 1's line
double m1 = (series1_Point2.YValues[0] - series1_Point1.YValues[0])
/(series1_Point2.XValue - series1_Point1.XValue);
//find the y intercept of series 1's line
double b1 = series1_Point2.YValues[0] - m1 * series1_Point2.XValue;
//find the slope of series 2's line
double m2 = (series2_Point2.YValues[0] - series2_Point1.YValues[0])
/ (series2_Point2.XValue - series2_Point1.XValue);
//check to make sure the lines aren't parallel
if (m2 == m1)
{
//the lines are parallel so they can not intersect
return null;
}
// find the y intercept of series 2's line
double b2 = series2_Point2.YValues[0] - m2 * series2_Point2.XValue;
//find where the two lines intersect
double xIntersection = (b2 - b1) / (m1 - m2);
//find the max and min X interval of the two line segments
double xmin=0;
double xmax=0;
if (series1_Point1.XValue >= series2_Point1.XValue)
{
xmin = series1_Point1.XValue;
}
else
{
xmin = series2_Point1.XValue;
}
if (series1_Point2.XValue >= series2_Point2.XValue)
{
xmax = series2_Point2.XValue;
}
else
{
xmax = series1_Point2.XValue;
}
//check to see if the xIntersection falls in this range
if (xIntersection >= xmin && xIntersection <= xmax)
{
//figure out the Y value now
double yIntersection = m1 * xIntersection + b1;
return new DataPoint(xIntersection, yIntersection);
}
return null;
}
开发者ID:iProcyonidae,项目名称:MVS,代码行数:69,代码来源:LineUtils.cs
示例16: Clone
public DataPoint Clone ()
{
DataPoint clone = new DataPoint (XValue, YValue);
clone.IsEmpty = IsEmpty;
clone.Name = Name;
return clone;
}
开发者ID:carrie901,项目名称:mono,代码行数:8,代码来源:DataPoint.cs
示例17: GetAbsolutePoint
/// <summary>
/// Get the absolute location of dp
/// </summary>
/// <param name="cg">for finding the absolute location</param>
/// <param name="dp"></param>
/// <returns></returns>
public static PointF GetAbsolutePoint(ChartGraphics cg, DataPoint dp)
{
PointF p1 = new PointF(
(float)cg.GetPositionFromAxis("Default", AxisName.X, dp.XValue),
(float)cg.GetPositionFromAxis("Default", AxisName.Y, dp.YValues[0]));
p1 = cg.GetAbsolutePoint(p1);
return p1;
}
开发者ID:iProcyonidae,项目名称:MVS,代码行数:14,代码来源:LineUtils.cs
示例18: plotLineGraph
public static void plotLineGraph(List<double> values, Chart cart)
{
cart.Series["Series1"].Points.Clear();
for (int i = 0; i < values.Count; i++)
{
System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(i, values[i]);
cart.Series["Series1"].Points.Add(dataPoint1);
}
}
开发者ID:helicopter,项目名称:UAVHelicopter,代码行数:9,代码来源:Form1.cs
示例19: AppendData
/// <summary>
/// グラフにデータを追加
/// </summary>
/// <param name="name">系列名</param>
/// <param name="x">X座標データ</param>
/// <param name="y">Y座標データ</param>
public void AppendData(string name, double x, double y)
{
// データポイントを生成
DataPoint point = new DataPoint(x, y);
// 系列名からデータを追加する系列を取得
Series s = chart.Series.FindByName(name);
// データを追加
s.Points.Add(point);
}
开发者ID:an-embedded-engineer,项目名称:NxtManager,代码行数:15,代码来源:NxtChart.cs
示例20: Constructor3
public void Constructor3 ()
{
DataPoint dp = new DataPoint (1d, new double[] { 2d, 3d });
Assert.AreEqual (false, dp.IsEmpty, "A1");
Assert.AreEqual ("DataPoint", dp.Name, "A2");
Assert.AreEqual (1d, dp.XValue, "A3");
Assert.AreEqual (new double[] { 2d, 3d }, dp.YValues, "A4");
}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:DataPointTest.cs
注:本文中的System.Windows.Forms.DataVisualization.Charting.DataPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论