本文整理汇总了C#中ZedGraph.Axis类的典型用法代码示例。如果您正苦于以下问题:C# Axis类的具体用法?C# Axis怎么用?C# Axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Axis类属于ZedGraph命名空间,在下文中一共展示了Axis类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Synchronize
private void Synchronize( Axis source, Axis dest )
{
dest._scale._min = source._scale._min;
dest._scale._max = source._scale._max;
dest._scale._majorStep = source._scale._majorStep;
dest._scale._minorStep = source._scale._minorStep;
dest._scale._minAuto = source._scale._minAuto;
dest._scale._maxAuto = source._scale._maxAuto;
dest._scale._majorStepAuto = source._scale._majorStepAuto;
dest._scale._minorStepAuto = source._scale._minorStepAuto;
}
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:11,代码来源:ZedGraphControl.ScrollBars.cs
示例2: ScaleState
/// <summary>
/// Construct a <see cref="ScaleState"/> from the specified <see cref="Axis"/>
/// </summary>
/// <param name="axis">The <see cref="Axis"/> from which to collect the scale
/// range settings.</param>
public ScaleState(Axis axis)
{
_min = axis._scale._min;
_minorStep = axis._scale._minorStep;
_majorStep = axis._scale._majorStep;
_max = axis._scale._max;
_majorUnit = axis._scale._majorUnit;
_minorUnit = axis._scale._minorUnit;
_format = axis._scale._format;
_mag = axis._scale._mag;
//this.numDec = axis.NumDec;
_minAuto = axis._scale._minAuto;
_majorStepAuto = axis._scale._majorStepAuto;
_minorStepAuto = axis._scale._minorStepAuto;
_maxAuto = axis._scale._maxAuto;
_formatAuto = axis._scale._formatAuto;
_magAuto = axis._scale._magAuto;
}
开发者ID:stewmc,项目名称:vixen,代码行数:26,代码来源:ScaleState.cs
示例3: ForceNumTics
private void ForceNumTics( Axis axis, int numTics )
{
if ( axis._scale.MaxAuto )
{
int nTics = axis._scale.CalcNumTics();
if ( nTics < numTics )
axis._scale._maxLinearized += axis._scale._majorStep * ( numTics - nTics );
}
}
开发者ID:cliffton2008,项目名称:JNMAutoTrader_Capital,代码行数:9,代码来源:GraphPane.cs
示例4: DrawSingleBar
/// <summary>
/// Draw the specified single bar (an individual "point") of this series to the specified
/// <see cref="Graphics"/> device. This method is not as efficient as
/// <see cref="DrawBars"/>, which draws the bars for all points. It is intended to be used
/// only for <see cref="BarType.SortedOverlay"/>, which requires special handling of each bar.
/// </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="curve">A <see cref="CurveItem"/> object representing the
/// <see cref="Bar"/>'s to be drawn.</param>
/// <param name="baseAxis">The <see cref="Axis"/> class instance that defines the base (independent)
/// axis for the <see cref="Bar"/></param>
/// <param name="valueAxis">The <see cref="Axis"/> class instance that defines the value (dependent)
/// axis for the <see cref="Bar"/></param>
/// <param name="pos">
/// The ordinal position of the this bar series (0=first bar, 1=second bar, etc.)
/// in the cluster of bars.
/// </param>
/// <param name="index">
/// The zero-based index number for the single bar to be drawn.
/// </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="GraphPane.CalcScaleFactor"/> method, and is used to proportionally adjust
/// font sizes, etc. according to the actual size of the graph.
/// </param>
public void DrawSingleBar( Graphics g, GraphPane pane, CurveItem curve,
Axis baseAxis, Axis valueAxis,
int pos, int index, double scaleFactor )
{
if ( index >= curve.Points.Count )
return;
//SetupBarStack( valueAxis, curve.Points.Count );
// For Overlay and Stack bars, the position is always zero since the bars are on top
// of eachother
if ( pane.BarType == BarType.Overlay || pane.BarType == BarType.Stack ||
pane.BarType == BarType.PercentStack )
pos = 0;
DrawSingleBar( g, pane, curve, index, pos, baseAxis, valueAxis,
scaleFactor );
}
开发者ID:InsungChoi,项目名称:dddd,代码行数:51,代码来源:Bar.cs
示例5: Clone
/// <summary>
/// Create a new clone of the current item, with a new owner assignment
/// </summary>
/// <param name="owner">The new <see cref="Axis" /> instance that will be
/// the owner of the new Scale</param>
/// <returns>A new <see cref="Scale" /> clone.</returns>
public override Scale Clone(Axis owner)
{
return new LinearAsOrdinalScale(this, owner);
}
开发者ID:stewmc,项目名称:vixen,代码行数:10,代码来源:LinearAsOrdinalScale.cs
示例6: LinearAsOrdinalScale
/// <summary>
/// Default constructor that defines the owner <see cref="Axis" />
/// (containing object) for this new object.
/// </summary>
/// <param name="owner">The owner, or containing object, of this instance</param>
public LinearAsOrdinalScale(Axis owner)
: base(owner)
{
}
开发者ID:stewmc,项目名称:vixen,代码行数:9,代码来源:LinearAsOrdinalScale.cs
示例7: OrdinalScale
/// <summary>
/// Default constructor that defines the owner <see cref="Axis" />
/// (containing object) for this new object.
/// </summary>
/// <param name="owner">The owner, or containing object, of this instance</param>
public OrdinalScale( Axis owner )
: base(owner)
{
}
开发者ID:viwhi1,项目名称:TDMaker,代码行数:9,代码来源:OrdinalScale.cs
示例8: Axis
/// <summary>
/// The Copy Constructor.
/// </summary>
/// <param name="rhs">The Axis object from which to copy</param>
public Axis( Axis rhs )
{
_scale = rhs._scale.Clone( this );
_cross = rhs._cross;
_crossAuto = rhs._crossAuto;
_majorTic = rhs.MajorTic.Clone();
_minorTic = rhs.MinorTic.Clone();
_majorGrid = rhs._majorGrid.Clone();
_minorGrid = rhs._minorGrid.Clone();
_isVisible = rhs.IsVisible;
_isAxisSegmentVisible = rhs._isAxisSegmentVisible;
_title = (AxisLabel) rhs.Title.Clone();
_axisGap = rhs._axisGap;
_minSpace = rhs.MinSpace;
_color = rhs.Color;
}
开发者ID:konrad-zielinski,项目名称:ZedGraph,代码行数:30,代码来源:Axis.cs
示例9: ZoomScale
/// <summary>
/// Zoom the specified axis by the specified amount, with the center of the zoom at the
/// (optionally) specified point.
/// </summary>
/// <remarks>
/// This method is used for MouseWheel zoom operations</remarks>
/// <param name="axis">The <see cref="Axis" /> to be zoomed.</param>
/// <param name="zoomFraction">The zoom fraction, less than 1.0 to zoom in, greater than 1.0 to
/// zoom out. That is, a value of 0.9 will zoom in such that the scale length is 90% of what
/// it previously was.</param>
/// <param name="centerVal">The location for the center of the zoom. This is only used if
/// <see paramref="IsZoomOnMouseCenter" /> is true.</param>
/// <param name="isZoomOnCenter">true if the zoom is to be centered at the
/// <see paramref="centerVal" /> screen position, false for the zoom to be centered within
/// the <see cref="Chart.Rect" />.
/// </param>
protected void ZoomScale(Axis axis, double zoomFraction, double centerVal, bool isZoomOnCenter)
{
if (axis != null && zoomFraction > 0.0001 && zoomFraction < 1000.0) {
Scale scale = axis._scale;
/*
if ( axis.Scale.IsLog )
{
double ratio = Math.Sqrt( axis._scale._max / axis._scale._min * zoomFraction );
if ( !isZoomOnCenter )
centerVal = Math.Sqrt( axis._scale._max * axis._scale._min );
axis._scale._min = centerVal / ratio;
axis._scale._max = centerVal * ratio;
}
else
{
*/
double minLin = axis._scale._minLinearized;
double maxLin = axis._scale._maxLinearized;
double range = (maxLin - minLin) * zoomFraction / 2.0;
if (!isZoomOnCenter)
centerVal = (maxLin + minLin) / 2.0;
axis._scale._minLinearized = centerVal - range;
axis._scale._maxLinearized = centerVal + range;
// }
axis._scale._minAuto = false;
axis._scale._maxAuto = false;
}
}
开发者ID:Jchuchla,项目名称:vixen,代码行数:49,代码来源:ZedGraphControl.Events.cs
示例10: PanScale
/// <summary>
/// Handle a panning operation for the specified <see cref="Axis" />.
/// </summary>
/// <param name="axis">The <see cref="Axis" /> to be panned</param>
/// <param name="startVal">The value where the pan started. The scale range
/// will be shifted by the difference between <see paramref="startVal" /> and
/// <see paramref="endVal" />.
/// </param>
/// <param name="endVal">The value where the pan ended. The scale range
/// will be shifted by the difference between <see paramref="startVal" /> and
/// <see paramref="endVal" />.
/// </param>
protected void PanScale(Axis axis, double startVal, double endVal)
{
if (axis != null) {
Scale scale = axis._scale;
double delta = scale.Linearize(startVal) - scale.Linearize(endVal);
scale._minLinearized += delta;
scale._maxLinearized += delta;
scale._minAuto = false;
scale._maxAuto = false;
/*
if ( axis.Type == AxisType.Log )
{
axis._scale._min *= startVal / endVal;
axis._scale._max *= startVal / endVal;
}
else
{
axis._scale._min += startVal - endVal;
axis._scale._max += startVal - endVal;
}
*/
}
}
开发者ID:Jchuchla,项目名称:vixen,代码行数:38,代码来源:ZedGraphControl.Events.cs
示例11: MakeValueLabel
/// <summary>
/// Make a string label that corresponds to a user scale value.
/// </summary>
/// <param name="axis">The axis from which to obtain the scale value. This determines
/// if it's a date value, linear, log, etc.</param>
/// <param name="val">The value to be made into a label</param>
/// <param name="iPt">The ordinal position of the value</param>
/// <param name="isOverrideOrdinal">true to override the ordinal settings of the axis,
/// and prefer the actual value instead.</param>
/// <returns>The string label.</returns>
protected string MakeValueLabel(Axis axis, double val, int iPt, bool isOverrideOrdinal)
{
if (axis != null) {
if (axis.Scale.IsDate || axis.Scale.Type == AxisType.DateAsOrdinal) {
return XDate.ToString(val, _pointDateFormat);
}
else if (axis._scale.IsText && axis._scale._textLabels != null) {
int i = iPt;
if (isOverrideOrdinal)
i = (int)(val - 0.5);
if (i >= 0 && i < axis._scale._textLabels.Length)
return axis._scale._textLabels[i];
else
return (i + 1).ToString();
}
else if (axis.Scale.IsAnyOrdinal && axis.Scale.Type != AxisType.LinearAsOrdinal
&& !isOverrideOrdinal) {
return iPt.ToString(_pointValueFormat);
}
else
return val.ToString(_pointValueFormat);
}
else
return string.Empty;
}
开发者ID:Jchuchla,项目名称:vixen,代码行数:36,代码来源:ZedGraphControl.Events.cs
示例12: DrawSingleBar
/// <summary>
/// Draw the specified single bar (an individual "point") of this series to the specified
/// <see cref="Graphics"/> device. This method is not as efficient as
/// <see cref="DrawBars"/>, which draws the bars for all points. It is intended to be used
/// only for <see cref="BarType.SortedOverlay"/>, which requires special handling of each bar.
/// </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="curve">A <see cref="CurveItem"/> object representing the
/// <see cref="Bar"/>'s to be drawn.</param>
/// <param name="baseAxis">The <see cref="Axis"/> class instance that defines the base (independent)
/// axis for the <see cref="Bar"/></param>
/// <param name="valueAxis">The <see cref="Axis"/> class instance that defines the value (dependent)
/// axis for the <see cref="Bar"/></param>
/// <param name="pos">
/// The ordinal position of the this bar series (0=first bar, 1=second bar, etc.)
/// in the cluster of bars.
/// </param>
/// <param name="index">
/// The zero-based index number for the single bar to be drawn.
/// </param>
/// <param name="barWidth">
/// The width of each bar, in pixels.
/// </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>
public void DrawSingleBar(Graphics g, GraphPane pane, CurveItem curve,
Axis baseAxis, Axis valueAxis,
int pos, int index, float barWidth, float scaleFactor)
{
// Make sure that a bar value exists for the current curve and current ordinal position
if (index >= curve.Points.Count)
return;
// For Overlay and Stack bars, the position is always zero since the bars are on top
// of eachother
if (pane._barSettings.Type == BarType.Overlay || pane._barSettings.Type == BarType.Stack ||
pane._barSettings.Type == BarType.PercentStack)
pos = 0;
// Draw the specified bar
DrawSingleBar(g, pane, curve, index, pos, baseAxis, valueAxis, barWidth, scaleFactor);
}
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:53,代码来源:Bar.cs
示例13: Scale
/// <summary>
/// Copy Constructor. Create a new <see cref="Scale" /> object based on the specified
/// existing one.
/// </summary>
/// <param name="rhs">The <see cref="Scale" /> object to be copied.</param>
/// <param name="owner">The <see cref="Axis" /> object that will own the
/// new instance of <see cref="Scale" /></param>
public Scale( Scale rhs, Axis owner )
{
_ownerAxis = owner;
_min = rhs._min;
_max = rhs._max;
_majorStep = rhs._majorStep;
_minorStep = rhs._minorStep;
_exponent = rhs._exponent;
_baseTic = rhs._baseTic;
_minAuto = rhs._minAuto;
_maxAuto = rhs._maxAuto;
_majorStepAuto = rhs._majorStepAuto;
_minorStepAuto = rhs._minorStepAuto;
_magAuto = rhs._magAuto;
_formatAuto = rhs._formatAuto;
_minGrace = rhs._minGrace;
_maxGrace = rhs._maxGrace;
_mag = rhs._mag;
_isUseTenPower = rhs._isUseTenPower;
_isReverse = rhs._isReverse;
_isPreventLabelOverlap = rhs._isPreventLabelOverlap;
_isVisible = rhs._isVisible;
_isSkipFirstLabel = rhs._isSkipFirstLabel;
_isSkipLastLabel = rhs._isSkipLastLabel;
_isSkipCrossLabel = rhs._isSkipCrossLabel;
_majorUnit = rhs._majorUnit;
_minorUnit = rhs._minorUnit;
_format = rhs._format;
_isLabelsInside = rhs._isLabelsInside;
_align = rhs._align;
_alignH = rhs._alignH;
_fontSpec = (FontSpec) rhs._fontSpec.Clone();
_labelGap = rhs._labelGap;
if ( rhs._textLabels != null )
_textLabels = (string[])rhs._textLabels.Clone();
else
_textLabels = null;
}
开发者ID:sntree,项目名称:ZedGraph,代码行数:56,代码来源:Scale.cs
示例14: SetRange
/// <summary>
/// Define suitable default ranges for an axis in the event that
/// no data were available
/// </summary>
/// <param name="pane">The <see cref="GraphPane"/> of interest</param>
/// <param name="axis">The <see cref="Axis"/> for which to set the range</param>
internal void SetRange( GraphPane pane, Axis axis )
{
if ( _rangeMin >= Double.MaxValue || _rangeMax <= Double.MinValue )
{
// If this is a Y axis, and the main Y axis is valid, use it for defaults
if ( axis != pane.XAxis && axis != pane.X2Axis &&
pane.YAxis.Scale._rangeMin < double.MaxValue && pane.YAxis.Scale._rangeMax > double.MinValue )
{
_rangeMin = pane.YAxis.Scale._rangeMin;
_rangeMax = pane.YAxis.Scale._rangeMax;
}
// Otherwise, if this is a Y axis, and the main Y2 axis is valid, use it for defaults
else if ( axis != pane.XAxis && axis != pane.X2Axis &&
pane.Y2Axis.Scale._rangeMin < double.MaxValue && pane.Y2Axis.Scale._rangeMax > double.MinValue )
{
_rangeMin = pane.Y2Axis.Scale._rangeMin;
_rangeMax = pane.Y2Axis.Scale._rangeMax;
}
// Otherwise, just use 0 and 1
else
{
_rangeMin = 0;
_rangeMax = 1;
}
}
/*
if ( yMinVal >= Double.MaxValue || yMaxVal <= Double.MinValue )
{
if ( y2MinVal < Double.MaxValue && y2MaxVal > Double.MinValue )
{
yMinVal = y2MinVal;
yMaxVal = y2MaxVal;
}
else
{
yMinVal = 0;
yMaxVal = 0.01;
}
}
if ( y2MinVal >= Double.MaxValue || y2MaxVal <= Double.MinValue )
{
if ( yMinVal < Double.MaxValue && yMaxVal > Double.MinValue )
{
y2MinVal = yMinVal;
y2MaxVal = yMaxVal;
}
else
{
y2MinVal = 0;
y2MaxVal = 1;
}
}
*/
}
开发者ID:sntree,项目名称:ZedGraph,代码行数:63,代码来源:Scale.cs
示例15: TextScale
public TextScale(Axis owner)
: base(owner)
{
}
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:4,代码来源:TextScale.cs
示例16: Draw
/// <summary>
/// Draw all the <see cref="ErrorBar"/>'s to the specified <see cref="Graphics"/>
/// device as a an error bar at each defined point.
/// </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="curve">A <see cref="CurveItem"/> object representing the
/// <see cref="Bar"/>'s to be drawn.</param>
/// <param name="baseAxis">The <see cref="Axis"/> class instance that defines the base (independent)
/// axis for the <see cref="Bar"/></param>
/// <param name="valueAxis">The <see cref="Axis"/> class instance that defines the value (dependent)
/// axis for the <see cref="Bar"/></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>
public void Draw( Graphics g, GraphPane pane, ErrorBarItem curve,
Axis baseAxis, Axis valueAxis, float scaleFactor )
{
ValueHandler valueHandler = new ValueHandler( pane, false );
float pixBase, pixValue, pixLowValue;
double scaleBase, scaleValue, scaleLowValue;
if ( curve.Points != null && this.IsVisible )
{
using ( Pen pen = !curve.IsSelected ? new Pen( _color, _penWidth ) :
new Pen( Selection.Border.Color, Selection.Border.Width ) )
{
// Loop over each defined point
for ( int i = 0; i < curve.Points.Count; i++ )
{
valueHandler.GetValues( curve, i, out scaleBase,
out scaleLowValue, out scaleValue );
// Any value set to double max is invalid and should be skipped
// This is used for calculated values that are out of range, divide
// by zero, etc.
// Also, any value <= zero on a log scale is invalid
if ( !curve.Points[i].IsInvalid3D &&
( scaleBase > 0 || !baseAxis._scale.IsLog ) &&
( ( scaleValue > 0 && scaleLowValue > 0 ) || !valueAxis._scale.IsLog ) )
{
pixBase = baseAxis.Scale.Transform( curve.IsOverrideOrdinal, i, scaleBase );
pixValue = valueAxis.Scale.Transform( curve.IsOverrideOrdinal, i, scaleValue );
pixLowValue = valueAxis.Scale.Transform( curve.IsOverrideOrdinal, i, scaleLowValue );
//if ( this.fill.IsGradientValueType )
// brush = fill.MakeBrush( _rect, _points[i] );
this.Draw( g, pane, baseAxis is XAxis || baseAxis is X2Axis, pixBase, pixValue,
pixLowValue, scaleFactor, pen, curve.IsSelected,
curve.Points[i] );
}
}
}
}
}
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:67,代码来源:ErrorBar.cs
示例17: DateAsOrdinalScale
/// <summary>
/// Default constructor that defines the owner <see cref="Axis" />
/// (containing object) for this new object.
/// </summary>
/// <param name="owner">The owner, or containing object, of this instance</param>
public DateAsOrdinalScale( Axis owner )
: base(owner)
{
}
开发者ID:cliffton2008,项目名称:JNMAutoTrader_Capital,代码行数:9,代码来源:DateAsOrdinalScale.cs
示例18: AddColumnForAxis
/// <summary>
/// Adds the data for the <paramref name="axis"/> to the <see cref="DataFrameBuilder.DataFrame"/>.
/// If <paramref name="axis"/> is the <see cref="CurveItem.BaseAxis"/> then the column
/// is added as the <see cref="DataFrame.RowHeader"/>, otherwise it is added
/// to <see cref="DataFrame.ColumnGroups"/>.
/// The X-Axis is usually the base axis, but for bar graphs that display horizontally,
/// the Y-Axis is the base axis.
/// </summary>
protected virtual DataFrameBuilder AddColumnForAxis(DataFrameBuilder dataFrameBuilder, Axis axis)
{
var column = GetColumnForAxis(dataFrameBuilder, axis);
if (column == null)
{
return dataFrameBuilder;
}
var dataFrame = dataFrameBuilder.DataFrame;
if (dataFrame.RowHeader == null && ReferenceEquals(axis, dataFrameBuilder.BaseAxis))
{
dataFrame = dataFrame.SetRowHeaders(column);
}
else
{
dataFrame = dataFrame.AddColumn(column);
}
return dataFrameBuilder.SetDataFrame(dataFrame);
}
开发者ID:AlexandreBurel,项目名称:pwiz-mzdb,代码行数:26,代码来源:CurveDataHandler.cs
示例19: GetColumnForAxis
/// <summary>
/// Returns a <see cref="DataColumn"/> containing the values on the <paramref name="axis"/>.
/// If <see cref="Scale.IsText"/> is true for the <see cref="Axis.Scale"/>,
/// then the DataColumn will contain string values.
/// </summary>
protected virtual DataColumn GetColumnForAxis(DataFrameBuilder dataFrameBuilder, Axis axis)
{
if (axis == null)
{
return null;
}
if (axis.Scale.IsText)
{
var textValues = new string[dataFrameBuilder.Points.Count];
Array.Copy(axis.Scale.TextLabels, 0, textValues, 0, Math.Min(textValues.Length, axis.Scale.TextLabels.Length));
return new DataColumn<string>(axis.Title.Text, textValues);
}
if (axis.Scale.IsOrdinal)
{
return new DataColumn<int>(axis.Title.Text, Enumerable.Range(0, dataFrameBuilder.Points.Count));
}
var values = new double[dataFrameBuilder.Points.Count];
var valueOfPoint = ValueOfPointFuncForAxis(dataFrameBuilder, axis);
if (valueOfPoint != null)
{
for (int i = 0; i < dataFrameBuilder.Points.Count; i++)
{
values[i] = valueOfPoint(dataFrameBuilder.Points[i]);
}
}
if (values.Any(value=>PointPairBase.Missing == value))
{
var valuesWithNull = values.Select(value => PointPairBase.Missing == value ? (double?) null : value);
return new DataColumn<double?>(axis.Title.Text, valuesWithNull);
}
return new DataColumn<double>(axis.Title.Text, values);
}
开发者ID:AlexandreBurel,项目名称:pwiz-mzdb,代码行数:37,代码来源:CurveDataHandler.cs
示例20: ValueOfPointFuncForAxis
/// <summary>
/// Determines whether <paramref name="axis"/> is the X-Axis or the Y-Axis,
/// and returns a function that returns either <see cref="PointPair.X"/> or
/// <see cref="PointPair.Y"/>.
/// Returns null if the axis is neither.
/// </summary>
protected virtual Func<PointPair, double> ValueOfPointFuncForAxis(DataFrameBuilder dataFrameBuilder, Axis axis)
{
if (axis is XAxis || axis is X2Axis || ReferenceEquals(axis, dataFrameBuilder.XAxis))
{
return point => point.X;
}
if (axis is YAxis || axis is Y2Axis || ReferenceEquals(axis, dataFrameBuilder.YAxis))
{
return point => point.Y;
}
Trace.TraceError("Could not determine type of axis {0}", axis); // Not L10N
return null;
}
开发者ID:AlexandreBurel,项目名称:pwiz-mzdb,代码行数:19,代码来源:CurveDataHandler.cs
注:本文中的ZedGraph.Axis类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论