本文整理汇总了C#中ZedGraph.PointPair类的典型用法代码示例。如果您正苦于以下问题:C# PointPair类的具体用法?C# PointPair怎么用?C# PointPair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointPair类属于ZedGraph命名空间,在下文中一共展示了PointPair类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupPen
public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
{
if(callback(dataValue))
DefaultSetup(line, pen);
else
pen.DashStyle = DashStyle.Solid;
}
示例2: Page_Load
public void Page_Load(object sender, EventArgs e)
{
Double donnéeDeCourbe = 6.5;
double[] x = new double[100];
double[] maximum = new double[100];
double[] minimum = new double[100];
double[] moyenne = new double[100];
double[] variable = new double[100];
for (int i = 0; i < x.Length; i++)
{
x[i] = i;
maximum[i] = 9;
minimum[i] = 3;
moyenne[i] = 6;
variable[i] = donnéeDeCourbe;
}
// This is to remove all plots
zedGraphControl1.GraphPane.CurveList.Clear();
GraphPane myPane = zedGraphControl1.GraphPane;
// Définis la liste des points
PointPairList spl1 = new PointPairList(x, maximum);
PointPairList spl2 = new PointPairList(x, minimum);
PointPairList spl3 = new PointPairList(x, moyenne);
PointPairList spl4 = new PointPairList(x, variable);
PointPairList Ppl = new PointPairList();
int y =0;
foreach (Ech_Resultat Er in Ech_ResultatDB.List())
{
y++;
PointPair Pp = new PointPair(y, Er.Resultat, EchantillonDB.Get(Er.ID_Echantillon).NumLot);
Ppl.Add(Pp);
}
// Ajouter les lignes a mon graphique
LineItem myCurve1 = myPane.AddCurve("", spl1, Color.DarkBlue, SymbolType.None);
LineItem myCurve2 = myPane.AddCurve("Minimum Maximum", spl2, Color.DarkBlue, SymbolType.None);
LineItem myCurve3 = myPane.AddCurve("moyenne", spl3, Color.Black, SymbolType.None);
LineItem myCurve4 = myPane.AddCurve("Resultat", Ppl, Color.ForestGreen, SymbolType.Diamond);
myCurve1.Line.Width = 2.0F;
myCurve2.Line.Width = 2.0F;
myCurve3.Line.Width = 2.0F;
myCurve4.Line.Width = 2.0F;
myPane.Title.Text = "Graphique épaisseur peinture";
myPane.XAxis.Title.Text = "Test";
myPane.YAxis.Title.Text = "Epaisseur peinture";
myPane.Legend.Position = ZedGraph.LegendPos.Bottom;
// I add all three functions just to be sure it refeshes the plot.
zedGraphControl1.AxisChange();
zedGraphControl1.Invalidate();
zedGraphControl1.Refresh();
}
示例3: UpdateGraph
public void UpdateGraph()
{
zedGraphControl.GraphPane.GraphObjList.Clear();
zedGraphControl.GraphPane.CurveList.Clear();
var currentRow = bindingSource.Current as DataRow;
var target = comboTarget.SelectedItem;
if (currentRow != null)
{
var refinedPoints = new PointPairList();
var outliers = new PointPairList();
var regression = currentRow.Refined ?? currentRow.Unrefined;
if (regression != null && regression.OriginalTimes.Count > 0)
{
var outlierIndexes = regression.OutlierIndexes;
for (int i = 0; i < regression.TotalCount; i++)
{
var point = new PointPair(regression.OriginalTimes[i], regression.TargetTimes[i], currentRow.RegressedPeptides[i]);
if (outlierIndexes.Contains(i))
{
outliers.Add(point);
}
else
{
refinedPoints.Add(point);
}
}
var refinedScatter = zedGraphControl.GraphPane.AddCurve("Refined Points", refinedPoints, Color.Black, SymbolType.Diamond);
refinedScatter.Symbol.Size = 8f;
refinedScatter.Line.IsVisible = false;
refinedScatter.Symbol.Border.IsVisible = false;
refinedScatter.Symbol.Fill = new Fill(Color.DarkBlue);
if (outliers.Count > 0)
{
var outlierScatter = zedGraphControl.GraphPane.AddCurve("Outliers", outliers, Color.Black,
SymbolType.Diamond);
outlierScatter.Symbol.Size = 8f;
outlierScatter.Line.IsVisible = false;
outlierScatter.Symbol.Border.IsVisible = false;
outlierScatter.Symbol.Fill = new Fill(Color.BlueViolet);
}
double xMin = regression.OriginalTimes.Min();
double xMax = regression.OriginalTimes.Max();
var regressionLine = zedGraphControl.GraphPane
.AddCurve("Regression line", new[] { xMin, xMax },
new[] { xMin * regression.Slope + regression.Intercept,xMax * regression.Slope + regression.Intercept},
Color.Black);
regressionLine.Symbol.IsVisible = false;
zedGraphControl.GraphPane.Title.Text = string.Format("Alignment of {0} to {1}",
currentRow.MsDataFile,
target);
zedGraphControl.GraphPane.XAxis.Title.Text
= string.Format("Time from {0}", currentRow.DataFile);
zedGraphControl.GraphPane.YAxis.Title.Text = "Aligned time";
zedGraphControl.GraphPane.AxisChange();
zedGraphControl.Invalidate();
}
}
}
示例4: addPoint
public void addPoint(PointPair p)
{
if (points.Count >= 3)
{
throw new BarierIsFull("Введены все точки препятствия");
}
p.Y = interval.profile.getY(p.X);
points.Add(p);
points.Sort();
}
示例5: editPoint
public void editPoint(int index, PointPair p, PointPair oldP)
{
if (!interval.isPointOnInterval(p))
{
points[index] = oldP;
throw new InvalidPointPositon(p.ToString());
}
p.Y = interval.profile.getY(p.X);
points[index] = p;
points.Sort();
}
示例6: RenderTimeTaken
public void RenderTimeTaken()
{
ClearSeries();
var parser = new ResultsParser();
var times = parser.TimeLineDataForIndividualRequest(Results,Url);
var pane = Chart.GraphPane;
pane.Title.Text = "Time taken per request for\r\n" + Url;
pane.Title.FontSpec.FontColor = Color.DarkBlue;
pane.Title.FontSpec.Size = 14.25F;
pane.Title.FontSpec.IsBold = true;
pane.LineType = LineType.Normal;
pane.XAxis.Title.Text = "Request number";
pane.YAxis.Title.Text = "milli-seconds";
pane.Chart.Fill = new Fill(Color.LightYellow, Color.PaleGoldenrod, 45.0F);
Chart.IsShowPointValues = true;
PointPairList series = new PointPairList();
foreach (var req in times.Where( t=> !t.IsError ))
{
var pt = new PointPair(req.RequestNo, req.TimeTaken,req.TimeTaken.ToString());
series.Add(pt);
}
var curve = pane.AddCurve("Success", series, Color.Green, SymbolType.Circle);
curve.Line.Width = 2.0F;
curve.Line.IsAntiAlias = true;
curve.Symbol.Fill = new Fill(Color.LightYellow);
curve.Symbol.Size = 4;
PointPairList series2 = new PointPairList();
foreach (var req in times.Where( t=> t.IsError ))
{
var point = new PointPair(req.TimeTaken,req.RequestNo);
series2.Add(point);
}
var curve2 = pane.AddCurve("Errors", series2, Color.Red);
curve2.Line.Width = 2.0F;
curve2.Line.IsAntiAlias = true;
curve2.Symbol.Fill = new Fill(Color.White);
curve2.Symbol.Size = 4;
// Force refresh of chart
pane.AxisChange();
}
示例7: PointPair
// Indexer: get the Sample instance at the specified ordinal position in the list
public PointPair this[int index]
{
get
{
PointPair pt = new PointPair();
DateTimePlotPoint aPoint = aList[index];
pt.X = GetValue(aPoint, XType);
pt.Y = GetValue(aPoint, YType);
pt.Tag = aPoint.Tag;
return pt;
}
set
{
}
}
示例8: GetDouble
/// <summary>
/// Indexer to access the specified <see cref="PointPair"/> object by
/// its ordinal position in the list.
/// </summary>
/// <param name="index">The ordinal position (zero-based) of the
/// <see cref="PointPair"/> object to be accessed.</param>
/// <value>A <see cref="PointPair"/> object reference.</value>
public PointPair this[int index] {
get {
if (index < 0 || index >= _bindingSource.Count)
throw new System.ArgumentOutOfRangeException("Error: Index out of range");
object row = _bindingSource[index];
double x = GetDouble(row, _xDataMember, index);
double y = GetDouble(row, _yDataMember, index);
double z = GetDouble(row, _zDataMember, index);
object tag = GetObject(row, _tagDataMember);
PointPair pt = new PointPair(x, y, z);
pt.Tag = tag;
return pt;
}
}
示例9: GetPen
/// <summary>
/// Create a <see cref="Pen" /> object based on the properties of this
/// <see cref="LineBase" />.
/// </summary>
/// <param name="pane">The owner <see cref="GraphPane" /> of this
/// <see cref="LineBase" />.
/// </param>
/// <param name="scaleFactor">
/// The scaling factor to be used for rendering objects. This is calculated and
/// passed down by the parent <see cref="GraphPane"/> object using the
/// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
/// font sizes, etc. according to the actual size of the graph.
/// </param>
/// <param name="dataValue">The data value to be used for a value-based
/// color gradient. This is only applicable if <see cref="Fill.Type">GradientFill.Type</see>
/// is one of <see cref="FillType.GradientByX"/>,
/// <see cref="FillType.GradientByY"/>, <see cref="FillType.GradientByZ"/>,
/// or <see cref="FillType.GradientByColorValue" />.
/// </param>
/// <returns>A <see cref="Pen" /> object with the properties of this <see cref="LineBase" />
/// </returns>
public Pen GetPen( PaneBase pane, float scaleFactor, PointPair dataValue )
{
Color color = _color;
if ( _gradientFill.IsGradientValueType )
color = _gradientFill.GetGradientColor( dataValue );
Pen pen = new Pen( color,
pane.ScaledPenWidth( _width, scaleFactor ) );
pen.DashStyle = _style;
if ( _style == DashStyle.Custom )
{
CustomDashes.SetupPen(pen, this, dataValue);
}
return pen;
}
示例10: Add
/// <summary>
/// Add a set of values onto the head of the queue,
/// overwriting old values if the buffer is full.
/// </summary>
/// <remarks>
/// This method is much more efficient that the <see cref="Add(PointPair)">Add(PointPair)</see>
/// method, since it does not require that a new PointPair instance be provided.
/// If the buffer already contains a <see cref="PointPair"/> at the head position,
/// then the x, y, z, and tag values will be copied into the existing PointPair.
/// Otherwise, a new PointPair instance must be created.
/// In this way, each PointPair position in the rolling list will only be allocated one time.
/// To truly be memory efficient, the <see cref="Remove" />, <see cref="RemoveAt" />,
/// and <see cref="Pop" /> methods should be avoided. Also, the <paramref name="tag"/> property
/// for this method should be null, since it is a reference type.
/// </remarks>
/// <param name="x">The X value</param>
/// <param name="y">The Y value</param>
/// <param name="z">The Z value</param>
/// <param name="tag">The Tag value for the PointPair</param>
public void Add( double x, double y, double z, object tag )
{
// advance the rolling list
GetNextIndex();
if ( _mBuffer[_headIdx] == null )
_mBuffer[_headIdx] = new PointPair( x, y, z, tag );
else
{
_mBuffer[_headIdx].X = x;
_mBuffer[_headIdx].Y = y;
_mBuffer[_headIdx].Z = z;
_mBuffer[_headIdx].Tag = tag;
}
}
示例11: RollingPointPairList
/// <summary>
/// Constructs a buffer with a copy of the items within the provided
/// <see cref="IPointList" />.
/// The <see cref="Capacity" /> is set to the length of the provided list.
/// </summary>
/// <param name="rhs">The <see cref="IPointList" /> to be copied.</param>
public RollingPointPairList( IPointList rhs )
{
_mBuffer = new PointPair[rhs.Count];
for ( int i = 0; i < rhs.Count; i++ )
{
_mBuffer[i] = new PointPair( rhs[i] );
}
_headIdx = rhs.Count - 1;
_tailIdx = 0;
}
示例12: Profile
public Profile(PointPair begin, PointPair end, Interval interval)
{
points = new PointPairList();
points.Add(begin);
points.Add(end);
this.interval = interval;
curve = new LineItem("Профиль интервала", points, Color.Black, SymbolType.Circle);
interval.graphPane.CurveList.Add(curve);
}
示例13: AnnotatePoint
public override PointAnnotation AnnotatePoint(PointPair point)
{
return null;
}
示例14: Draw
/// <summary>
/// Draw the <see cref="ErrorBar"/> to the specified <see cref="Graphics"/>
/// device at the specified location.
/// </summary>
/// <param name="g">
/// A graphic device object to be drawn into. This is normally e.Graphics from the
/// PaintEventArgs argument to the Paint() method.
/// </param>
/// <param name="pane">
/// A reference to the <see cref="GraphPane"/> object that is the parent or
/// owner of this object.
/// </param>
/// <param name="isXBase">boolean value that indicates if the "base" axis for this
/// <see cref="ErrorBar"/> is the X axis. True for an <see cref="XAxis"/> base,
/// false for a <see cref="YAxis"/> or <see cref="Y2Axis"/> base.</param>
/// <param name="pixBase">The independent axis position of the center of the error bar in
/// pixel units</param>
/// <param name="pixValue">The dependent axis position of the top of the error bar in
/// pixel units</param>
/// <param name="pixLowValue">The dependent axis position of the bottom of the error bar in
/// pixel units</param>
/// <param name="scaleFactor">
/// The scaling factor for the features of the graph based on the <see cref="PaneBase.BaseDimension"/>. This
/// scaling factor is calculated by the <see cref="PaneBase.CalcScaleFactor"/> method. The scale factor
/// represents a linear multiple to be applied to font sizes, symbol sizes, etc.</param>
/// <param name="pen">A pen with attributes of <see cref="Color"/> and
/// <see cref="PenWidth"/> for this <see cref="ErrorBar"/></param>
/// <param name="dataValue">The data value to be used for a value-based
/// color gradient. This is only applicable for <see cref="FillType.GradientByX"/>,
/// <see cref="FillType.GradientByY"/> or <see cref="FillType.GradientByZ"/>.</param>
/// <param name="isSelected">Indicates that the <see cref="ErrorBar" /> should be drawn
/// with attributes from the <see cref="Selection" /> class.
/// </param>
public void Draw( Graphics g, GraphPane pane, bool isXBase,
float pixBase, float pixValue,
float pixLowValue, float scaleFactor, Pen pen, bool isSelected,
PointPair dataValue )
{
if ( isXBase )
{
g.DrawLine( pen, pixBase, pixValue, pixBase, pixLowValue );
_symbol.DrawSymbol( g, pane, (int)pixBase, (int)pixValue,
scaleFactor, isSelected, dataValue );
_symbol.DrawSymbol( g, pane, (int)pixBase, (int)pixLowValue,
scaleFactor, isSelected, dataValue );
}
else
{
g.DrawLine( pen, pixValue, pixBase, pixLowValue, pixBase );
_symbol.DrawSymbol( g, pane, (int)pixValue, (int)pixBase,
scaleFactor, isSelected, dataValue );
_symbol.DrawSymbol( g, pane, (int)pixLowValue, (int)pixBase,
scaleFactor, isSelected, dataValue );
}
}
示例15: SyntheticBarier
public SyntheticBarier(Interval interval, PointPair p)
{
points = new PointPairList();
this.interval = interval;
Symbol.Default.FillType = FillType.Solid;
curve = new LineItem("", points, Color.Sienna, SymbolType.Square);
Symbol.Default.FillType = FillType.Brush;
interval.graphPane.CurveList.Add(curve);
curve.IsVisible = true; // Видимы только точки, без линий
barierType = "Лес";
}