• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AxisDimension类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetOrigin

 double GetOrigin(AxisDimension ad)
 {
     if (ad == AxisDimension.X)
         return OriginX;
     else
         return OriginY;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs


示例2: GetEnd

 double GetEnd(AxisDimension ad)
 {
     if (ad == AxisDimension.X)
         return endX;
     else
         return endY;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs


示例3: GetMinTickStep

 double GetMinTickStep(AxisDimension ad)
 {
     return (((double) minTickStep) * (GetEnd (ad) - GetStart (ad))) / (double) GetAreaSize (ad);
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:BasicChart.cs


示例4: 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


示例5: GetAreaSize

 int GetAreaSize(AxisDimension ad)
 {
     if (ad == AxisDimension.X)
         return width;
     else
         return height;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs


示例6: GetValueRange

        void GetValueRange(AxisDimension ad, out double min, out double max)
        {
            min = double.MaxValue;
            max = double.MinValue;

            foreach (Serie serie in series) {
                if (!serie.HasData || !serie.Visible)
                    continue;

                double lmin, lmax;
                serie.GetRange (ad, out lmin, out lmax);
                if (lmin < min) min = lmin;
                if (lmax > max) max = lmax;
            }
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:BasicChart.cs


示例7: SetAutoScale

		public void SetAutoScale (AxisDimension ad, bool autoStart, bool autoEnd)
		{
			widget.SetAutoScale (ad, autoStart, autoEnd);
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:4,代码来源:BasicChart.cs


示例8: GetValue

 private double GetValue(IRun run, AxisDimension axisDimension) {
   double value = double.NaN;
   switch (axisDimension) {
     case AxisDimension.Color: {
         value = GetCategoricalValue(-1, run.Color.ToString());
         break;
       }
     default: {
         throw new ArgumentException("No handling strategy for " + axisDimension + " is defined.");
       }
   }
   return value;
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:13,代码来源:SampleSizeInfluenceView.cs


示例9: GetValue

    private double? GetValue(IRun run, AxisDimension axisDimension) {
      double? value = double.NaN;
      switch (axisDimension) {
        case AxisDimension.Color: {
            const int colorDimension = -1;
            if (!categoricalMapping.ContainsKey(colorDimension)) {
              categoricalMapping[colorDimension] = Content.Where(r => r.Visible)
                  .Select(r => r.Color.Name)
                  .Distinct()
                  .OrderBy(c => c, new NaturalStringComparer())
                  .Select((c, i) => new { Color = c, Index = i })
                  .ToDictionary(a => (object)a.Color, a => (double)a.Index);

            }
            value = GetCategoricalValue(colorDimension, run.Color.Name);
            break;
          }
        default: {
            throw new ArgumentException("No handling strategy for " + axisDimension.ToString() + " is defined.");
          }
      }
      return value;
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:23,代码来源:RunCollectionBoxPlotView.cs


示例10: GetRange

		public void GetRange (AxisDimension axis, out double min, out double max)
		{
			min = double.MaxValue;
			max = double.MinValue;
			foreach (Data d in dataArray) {
				double v = d.GetValue (axis);
				if (v > max) max = v;
				if (v < min) min = v;
			}
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:10,代码来源:Serie.cs


示例11: GetValue

		public double GetValue (AxisDimension a) {
			if (a == AxisDimension.X) return x;
			else return y;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:4,代码来源:Serie.cs


示例12: MeasureTicksSize

		double MeasureTicksSize (Context ctx, TickEnumerator e, AxisDimension ad)
		{
			double max = 0;
			TextLayout layout = new TextLayout ();
			layout.Font = chartFont;
			
			double start = GetStart (ad);
			double end = GetEnd (ad);
			
			e.Init (GetOrigin (ad));
			
			while (e.CurrentValue > start)
				e.MovePrevious ();
			
			for ( ; e.CurrentValue <= end; e.MoveNext ())
			{
				layout.Text = e.CurrentLabel;
				Size ts = layout.GetSize ();
				
				if (ad == AxisDimension.X) {
					if (ts.Height > max)
						max = ts.Height;
				} else {
					if (ts.Width > max)
						max = ts.Width;
				}
			}
			return max;
		}
开发者ID:m13253,项目名称:xwt,代码行数:29,代码来源:BasicChart.cs


示例13: DrawTicks

		void DrawTicks (Context ctx, TickEnumerator e, AxisPosition pos, AxisDimension ad, int tickSize, bool showLabels)
		{
			double rheight = Bounds.Height;
			
			TextLayout layout = null;
			
			if (showLabels) {
				layout = new TextLayout ();
				layout.Font = chartFont;
			}
			
			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 ();
			
			double lastPosLabel;
			double lastPos;
			double 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 ())
			{
				double px, py;
				double tw = 0, th = 0;
				int tick = tickSize;
				
				GetPoint (e.CurrentValue, e.CurrentValue, out px, out py);
				
				if (showLabels) {
					layout.Text = e.CurrentLabel;
					var ts = layout.GetSize ();
					tw = ts.Width;
					th = ts.Height;
				}

				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)
								ctx.DrawTextLayout (layout, px - (tw/2), top - AreaBorderWidth - th);
							else
								tick = tick / 2;
						}
						ctx.MoveTo (px, top);
						ctx.LineTo (px, top + tick);
						ctx.Stroke ();
					}
					else {
						if (showLabels) {
							if (labelFits)
								ctx.DrawTextLayout (layout, px - (tw/2), top + height + AreaBorderWidth);
							else
								tick = tick / 2;
						}
						ctx.MoveTo (px, top + height);
						ctx.LineTo (px, top + height - tick);
						ctx.Stroke ();
					}
				}
				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)
//.........这里部分代码省略.........
开发者ID:m13253,项目名称:xwt,代码行数:101,代码来源:BasicChart.cs


示例14: GetValue

 private double GetValue(IRun run, AxisDimension axisDimension) {
   double value = double.NaN;
   switch (axisDimension) {
     case AxisDimension.Index: {
         value = runToIndexMapping[run];
         break;
       }
     default: {
         throw new ArgumentException("No handling strategy for " + axisDimension.ToString() + " is defined.");
       }
   }
   return value;
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:13,代码来源:RunCollectionBubbleChartView.cs


示例15: GetStart

 double GetStart(AxisDimension ad)
 {
     if (ad == AxisDimension.X)
         return startX;
     else
         return startY;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs


示例16: AddCursor

 public void AddCursor(ChartCursor cursor, AxisDimension dimension)
 {
     cursor.Dimension = dimension;
     cursor.ValueChanged += new EventHandler (OnCursorChanged);
     cursor.LayoutChanged += new EventHandler (OnCursorChanged);
     cursors.Add (cursor);
     xrangeChanged = yrangeChanged = true;
     QueueDraw ();
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:9,代码来源:BasicChart.cs


示例17: GetValueLabel

 string GetValueLabel(AxisDimension ad, double value)
 {
     foreach (Axis ax in axis)
         if (ax.Dimension == ad)
             return ax.GetValueLabel (value);
     return null;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:BasicChart.cs


示例18: SetAutoScale

 public void SetAutoScale(AxisDimension ad, bool autoStart, bool autoEnd)
 {
     if (ad == AxisDimension.X) {
         autoStartX = autoStart;
         autoEndX = autoEnd;
     } else {
         autoStartY = autoStart;
         autoEndY = autoEnd;
     }
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:BasicChart.cs


示例19: MeasureTicksSize

        int MeasureTicksSize(TickEnumerator e, AxisDimension ad)
        {
            int max = 0;
            Pango.Layout layout = new Pango.Layout (this.PangoContext);
            layout.FontDescription = Pango.FontDescription.FromString ("Tahoma 8");

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

            e.Init (GetOrigin (ad));

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

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

                layout.SetMarkup (e.CurrentLabel);
                layout.GetPixelSize (out tw, out th);

                if (ad == AxisDimension.X) {
                    if (th > max)
                        max = th;
                } else {
                    if (tw > max)
                        max = tw;
                }
            }
            return max;
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:31,代码来源:BasicChart.cs


示例20: AddCursor

		public void AddCursor (ChartCursor cursor, AxisDimension dimension)
		{
			widget.AddCursor (cursor, dimension);
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:4,代码来源:BasicChart.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AxisPosition类代码示例发布时间:2022-05-24
下一篇:
C# Axis类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap