当前位置: 首页>>代码示例>>C#>>正文


C# CurveItem.ValueAxis方法代码示例

本文整理汇总了C#中ZedGraph.CurveItem.ValueAxis方法的典型用法代码示例。如果您正苦于以下问题:C# CurveItem.ValueAxis方法的具体用法?C# CurveItem.ValueAxis怎么用?C# CurveItem.ValueAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZedGraph.CurveItem的用法示例。


在下文中一共展示了CurveItem.ValueAxis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataFrameBuilder

 public DataFrameBuilder(GraphPane graphPane, CurveItem curveItem)
 {
     GraphPane = graphPane;
     CurveItem = curveItem;
     var msPointList = curveItem.Points as MSPointList;
     if (msPointList != null)
     {
         Points = msPointList.FullList;
     }
     else
     {
         Points = curveItem.Points;
     }
     XAxis = curveItem.GetXAxis(graphPane);
     YAxis = curveItem.GetYAxis(graphPane);
     BaseAxis = curveItem.BaseAxis(graphPane);
     ValueAxis = curveItem.ValueAxis(graphPane);
 }
开发者ID:AlexandreBurel,项目名称:pwiz-mzdb,代码行数:18,代码来源:DataFrameBuilder.cs

示例2: GetValues

        /// <summary>
        /// Get the user scale values associate with a particular point of a
        /// particular curve.</summary>
        /// <remarks>The main purpose of this method is to handle
        /// stacked bars and lines, in which case the stacked values are returned rather
        /// than the individual data values.  However, this method works generically for any
        /// curve type.
        /// </remarks>
        /// <param name="pane">The parent <see cref="GraphPane"/> object.</param>
        /// <param name="curve">A <see cref="CurveItem"/> object of interest.</param>
        /// <param name="iPt">The zero-based point index for the point of interest.</param>
        /// <param name="baseVal">A <see cref="Double"/> value representing the value
        /// for the independent axis.</param>
        /// <param name="lowVal">A <see cref="Double"/> value representing the lower
        /// value for the dependent axis.</param>
        /// <param name="hiVal">A <see cref="Double"/> value representing the upper
        /// value for the dependent axis.</param>
        /// <returns>true if the data point is value, false for
        /// <see cref="PointPairBase.Missing"/>, invalid, etc. data.</returns>
        public static bool GetValues( GraphPane pane, CurveItem curve, int iPt,
							out double baseVal, out double lowVal, out double hiVal )
        {
            hiVal = PointPair.Missing;
            lowVal = PointPair.Missing;
            baseVal = PointPair.Missing;

            if ( curve == null || curve.Points.Count <= iPt || !curve.IsVisible )
                return false;

            Axis baseAxis = curve.BaseAxis( pane );
            Axis valueAxis = curve.ValueAxis( pane );

            if ( baseAxis is XAxis || baseAxis is X2Axis )
                baseVal = curve.Points[iPt].X;
            else
                baseVal = curve.Points[iPt].Y;

            // is it a stacked bar type?
            if ( curve is BarItem && ( pane._barSettings.Type == BarType.Stack ||
                        pane._barSettings.Type == BarType.PercentStack ) )
            {
                double positiveStack = 0;
                double negativeStack = 0;
                double curVal;

                // loop through all the curves, summing up the values to get a total (only
                // for the current ordinal position iPt)
                foreach ( CurveItem tmpCurve in pane.CurveList )
                {
                    // Sum the value for the current curve only if it is a bar
                    if ( tmpCurve.IsBar && tmpCurve.IsVisible )
                    {
                        curVal = PointPair.Missing;
                        // For non-ordinal curves, find a matching base value (must match exactly)
                        if ( curve.IsOverrideOrdinal || !baseAxis._scale.IsAnyOrdinal )
                        {
                            IPointList points = tmpCurve.Points;

                            for ( int i=0; i<points.Count; i++ )
                            {
                                if ( ( baseAxis is XAxis || baseAxis is X2Axis ) && points[i].X == baseVal )
                                {
                                    curVal = points[i].Y;
                                    break;
                                }
                                else if ( !(baseAxis is XAxis || baseAxis is X2Axis) && points[i].Y == baseVal )
                                {
                                    curVal = points[i].X;
                                    break;
                                }
                            }
                        }
                        // otherwise, it's an ordinal type so use the value at the same ordinal position
                        else if ( iPt < tmpCurve.Points.Count )
                        {
                            // Get the value for the appropriate value axis
                            if ( baseAxis is XAxis || baseAxis is X2Axis )
                                curVal = tmpCurve.Points[iPt].Y;
                            else
                                curVal = tmpCurve.Points[iPt].X;
                        }

                        // If it's a missing value, skip it
                        if ( curVal == PointPair.Missing )
                        {
                            positiveStack = PointPair.Missing;
                            negativeStack = PointPair.Missing;
                        }

                        // the current curve is the target curve, save the summed values for later
                        if ( tmpCurve == curve )
                        {
                            // if the value is positive, use the positive stack
                            if ( curVal >= 0 )
                            {
                                lowVal = positiveStack;
                                hiVal = ( curVal == PointPair.Missing || positiveStack == PointPair.Missing ) ?
                                        PointPair.Missing : positiveStack + curVal;
                            }
                            // otherwise, use the negative stack
//.........这里部分代码省略.........
开发者ID:konrad-zielinski,项目名称:ZedGraph,代码行数:101,代码来源:ValueHandler.cs


注:本文中的ZedGraph.CurveItem.ValueAxis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。