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


C# AxisPosition类代码示例

本文整理汇总了C#中AxisPosition的典型用法代码示例。如果您正苦于以下问题:C# AxisPosition类的具体用法?C# AxisPosition怎么用?C# AxisPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: RangeColorAxis

        private static PlotModel RangeColorAxis(AxisPosition position)
        {
            int n = 1000;
            var model = new PlotModel
            {
                Title = string.Format("ScatterSeries and RangeColorAxis (n={0})", n),
                Background = OxyColors.LightGray
            };

            model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
            model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });

            var rca = new RangeColorAxis { Position = position, Maximum = 2, Minimum = -2 };
            rca.AddRange(0, 0.5, OxyColors.Blue);
            rca.AddRange(-0.2, -0.1, OxyColors.Red);
            model.Axes.Add(rca);

            var s1 = new ScatterSeries { MarkerType = MarkerType.Square, MarkerSize = 6, };

            var random = new Random(13);
            for (int i = 0; i < n; i++)
            {
                double x = (random.NextDouble() * 2.2) - 1.1;
                s1.Points.Add(new ScatterPoint(x, random.NextDouble()) { Value = x });
            }

            model.Series.Add(s1);
            return model;
        }
开发者ID:huoxudong125,项目名称:oxyplot,代码行数:29,代码来源:RangeColorAxisExamples.cs

示例2: Axis

 public Axis(AxisPosition pos, double minimum, double maximum)
     : this()
 {
     Position = pos;
     Minimum = minimum;
     Maximum = maximum;
 }
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:7,代码来源:RangeAxis.cs

示例3: LogarithmicAxis

 public LogarithmicAxis(AxisPosition position, string title = null, double minimum = double.NaN, double maximum = double.NaN)
     : this()
 {
     this.Position = position;
     this.Title = title;
     this.Minimum = minimum;
     this.Maximum = maximum;
 }
开发者ID:Celderon,项目名称:oxyplot,代码行数:8,代码来源:LogarithmicAxis.cs

示例4: CreateRandomScatterSeriesWithColorAxisPlotModel

 private static PlotModel CreateRandomScatterSeriesWithColorAxisPlotModel(int n, OxyPalette palette, MarkerType markerType, AxisPosition colorAxisPosition, OxyColor highColor, OxyColor lowColor)
 {
     var model = new PlotModel { Title = string.Format("ScatterSeries (n={0})", n), Background = OxyColors.LightGray };
     var colorAxis = new LinearColorAxis { Position = colorAxisPosition, Palette = palette, Minimum = -1, Maximum = 1, HighColor = highColor, LowColor = lowColor };
     model.Axes.Add(colorAxis);
     model.Series.Add(CreateRandomScatterSeries(n, markerType, false, true, colorAxis));
     return model;
 }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:8,代码来源:ScatterSeriesExamples.cs

示例5: LinearAxis

 public LinearAxis(AxisPosition position, double minimum, double maximum, double majorStep, double minorStep, string title = null)
     : this(position, title)
 {
     this.Minimum = minimum;
     this.Maximum = maximum;
     this.MajorStep = majorStep;
     this.MinorStep = minorStep;
 }
开发者ID:Celderon,项目名称:oxyplot,代码行数:8,代码来源:LinearAxis.cs

示例6: TimeSpanAxis

 public TimeSpanAxis(
     AxisPosition position,
     double minimum,
     double maximum = double.NaN,
     string title = null,
     string format = "m:ss")
     : base(position, minimum, maximum, title)
 {
     this.StringFormat = format;
 }
开发者ID:Celderon,项目名称:oxyplot,代码行数:10,代码来源:TimeSpanAxis.cs

示例7: YSeriesAxis

        /// <summary>
        /// Creates an instance of YSeriesAxis.
        /// </summary>
        /// <param name="chart"></param>
        /// <param name="series"></param>
        /// <param name="position"></param>
        public YSeriesAxis(C1Chart chart, DataSeries series, AxisPosition position)
            : base(chart, series)
        {
            AxisType = AxisType.Y;
            Position = position;

            if ((position & AxisPosition.Far) > 0)
                AnnoAngle = 90;
            else
                AnnoAngle = -90;

            MinorTickHeight = 0;
        }
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:19,代码来源:YSeriesAxis.cs

示例8: DateTimeAxis

        public DateTimeAxis(
            AxisPosition position,
            string title = null,
            string format = null,
            DateTimeIntervalType intervalType = DateTimeIntervalType.Auto)
            : base(position, title)
        {
            this.FirstDayOfWeek = DayOfWeek.Monday;
            this.CalendarWeekRule = CalendarWeekRule.FirstFourDayWeek;

            this.StringFormat = format;
            this.IntervalType = intervalType;
        }
开发者ID:Celderon,项目名称:oxyplot,代码行数:13,代码来源:DateTimeAxis.cs

示例9: CreateRandomScatterSeriesWithColorAxisPlotModel

        public static PlotModel CreateRandomScatterSeriesWithColorAxisPlotModel(int n, OxyPalette palette, MarkerType markerType = MarkerType.Square, AxisPosition colorAxisPosition = AxisPosition.Right, OxyColor highColor = null, OxyColor lowColor = null)
        {
            var model = new PlotModel(string.Format("ScatterSeries (n={0})", n)) { Background = OxyColors.LightGray };
            model.Axes.Add(new ColorAxis { Position = colorAxisPosition, Palette = palette, Minimum = -1, Maximum = 1, HighColor = highColor, LowColor = lowColor });

            var s1 = new ScatterSeries
            {
                MarkerType = markerType,
                MarkerSize = 6,
            };
            var random = new Random();
            for (int i = 0; i < n; i++)
            {
                double x = random.NextDouble() * 2.2 - 1.1;
                s1.Points.Add(new ScatterPoint(x, random.NextDouble()) { Value = x });
            }

            model.Series.Add(s1);
            return model;
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:20,代码来源:ScatterSeriesExamples.cs

示例10: createAxis

        private void createAxis(long id, AxisPosition pos)
        {
            ctCatAx = chart.GetCTChart().plotArea.AddNewCatAx();
            ctCatAx.AddNewAxId().val = (uint)id;
            ctCatAx.AddNewAxPos();
            ctCatAx.AddNewScaling();
            ctCatAx.AddNewCrosses();
            ctCatAx.AddNewCrossAx();
            ctCatAx.AddNewTickLblPos().val = ST_TickLblPos.nextTo;
            ctCatAx.AddNewDelete();
            ctCatAx.AddNewMajorTickMark();
            ctCatAx.AddNewMinorTickMark();

            
            this.SetPosition(pos);
            this.SetOrientation(AxisOrientation.MinToMax);
            this.SetCrosses(AxisCrosses.AutoZero);
            this.IsVisible = true;
            this.SetMajorTickMark(AxisTickMark.Cross);
            this.SetMinorTickMark(AxisTickMark.None);
        }
开发者ID:89sos98,项目名称:npoi,代码行数:21,代码来源:XSSFCategoryAxis.cs

示例11: MeasureAxisSize

 int MeasureAxisSize(AxisPosition pos)
 {
     int max = 0;
     foreach (Axis ax in axis)
         if (ax.Position == pos && ax.ShowLabels) {
             int nmax = MeasureAxisSize (ax);
             if (nmax > max) max = nmax;
         }
     return max;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:BasicChart.cs

示例12: DrawTicks

        void DrawTicks(Gdk.Window win, Gdk.GC gc, TickEnumerator e, AxisPosition pos, AxisDimension ad, int tickSize, bool showLabels)
        {
            int rwidth, rheight;
            win.GetSize (out rwidth, out rheight);

            Pango.Layout layout = null;

            if (showLabels) {
                layout = new Pango.Layout (this.PangoContext);
                layout.FontDescription = Pango.FontDescription.FromString ("Tahoma 8");
            }

            bool isX = pos == AxisPosition.Top || pos == AxisPosition.Bottom;
            bool isTop = pos == AxisPosition.Top || pos == AxisPosition.Right;

            double start = GetStart (ad);
            double end = GetEnd (ad);

            e.Init (GetOrigin (ad));

            while (e.CurrentValue > start)
                e.MovePrevious ();

            int lastPosLabel;
            int lastPos;
            int lastTw = 0;

            if (isX) {
                lastPosLabel = reverseXAxis ? left + width + MinLabelGapX : left - MinLabelGapX;
                lastPos = left - minTickStep*2;
            }
            else {
                lastPosLabel = reverseYAxis ? top - MinLabelGapY : rheight + MinLabelGapY;
                lastPos = top + height + minTickStep*2;
            }

            for ( ; e.CurrentValue <= end; e.MoveNext ())
            {
                int px, py;
                int tw = 0, th = 0;
                int tick = tickSize;

                GetPoint (e.CurrentValue, e.CurrentValue, out px, out py);

                if (showLabels) {
                    layout.SetMarkup (e.CurrentLabel);
                    layout.GetPixelSize (out tw, out th);
                }

                if (isX) {
                    if (Math.Abs ((long)px - (long)lastPos) < minTickStep || px < left || px > left + width)
                        continue;
                    lastPos = px;

                    bool labelFits = false;
                    if ((Math.Abs (px - lastPosLabel) - (tw/2) - (lastTw/2)) >= MinLabelGapX) {
                        lastPosLabel = px;
                        lastTw = tw;
                        labelFits = true;
                    }

                    if (isTop) {
                        if (showLabels) {
                            if (labelFits)
                                win.DrawLayout (gc, px - (tw/2), top - AreaBorderWidth - th, layout);
                            else
                                tick = tick / 2;
                        }
                        win.DrawLine (gc, px, top, px, top + tick);
                    }
                    else {
                        if (showLabels) {
                            if (labelFits)
                                win.DrawLayout (gc, px - (tw/2), top + height + AreaBorderWidth, layout);
                            else
                                tick = tick / 2;
                        }
                        win.DrawLine (gc, px, top + height, px, top + height - tick);
                    }
                }
                else {
                    if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height)
                        continue;
                    lastPos = py;

                    bool labelFits = false;
                    if ((Math.Abs (py - lastPosLabel) - (th/2) - (lastTw/2)) >= MinLabelGapY) {
                        lastPosLabel = py;
                        lastTw = th;
                        labelFits = true;
                    }

                    if (isTop) {
                        if (showLabels) {
                            if (labelFits)
                                win.DrawLayout (gc, left + width + AreaBorderWidth + 1, py - (th/2), layout);
                            else
                                tick = tick / 2;
                        }
                        win.DrawLine (gc, left + width, py, left + width - tick, py);
//.........这里部分代码省略.........
开发者ID:Kalnor,项目名称:monodevelop,代码行数:101,代码来源:BasicChart.cs

示例13: AddAxis

 public void AddAxis(Axis ax, AxisPosition position)
 {
     ax.Owner = this;
     ax.Position = position;
     axis.Add (ax);
     QueueDraw ();
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs

示例14: CreateCategoryAxis

 public IChartAxis CreateCategoryAxis(AxisPosition pos)
 {
     long id = axis.Count + 1;
     XSSFCategoryAxis categoryAxis = new XSSFCategoryAxis(this, id, pos);
     if (axis.Count == 1)
     {
         IChartAxis ax = axis[0];
         ax.CrossAxis(categoryAxis);
         categoryAxis.CrossAxis(ax);
     }
     axis.Add(categoryAxis);
     return categoryAxis;
 }
开发者ID:eatage,项目名称:npoi,代码行数:13,代码来源:XSSFChart.cs

示例15: CreateValueAxis

 public IValueAxis CreateValueAxis(AxisPosition pos)
 {
     long id = axis.Count + 1;
     XSSFValueAxis valueAxis = new XSSFValueAxis(this, id, pos);
     if (axis.Count == 1)
     {
         IChartAxis ax = axis[0];
         ax.CrossAxis(valueAxis);
         valueAxis.CrossAxis(ax);
     }
     axis.Add(valueAxis);
     return valueAxis;
 }
开发者ID:eatage,项目名称:npoi,代码行数:13,代码来源:XSSFChart.cs


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