public Points AddPointsSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis, Color p_seriesColor, bool p_IsDateTime, bool p_showInLegend) { Steema.TeeChart.Styles.Points pointsSeries = new Points(); objChart.Series.Add(pointsSeries); pointsSeries.Pointer.Style = PointerStyles.Circle; pointsSeries.VertAxis = p_VertAxis; pointsSeries.XValues.DateTime = p_IsDateTime; pointsSeries.Title = p_SeriesName; pointsSeries.Marks.Visible = false; pointsSeries.ShowInLegend = p_showInLegend; pointsSeries.Color = p_seriesColor; pointsSeries.Pointer.HorizSize = 3; pointsSeries.Pointer.VertSize = 3; pointsSeries.Pointer.Pen.Visible = false; //if (p_VertAxis == VerticalAxis.Left || p_VertAxis == VerticalAxis.Right) //{ // pointsSeries.Pointer.HorizSize = 2; // pointsSeries.Pointer.VertSize = 2; //} //else //{ // pointsSeries.Pointer.HorizSize = 4; // pointsSeries.Pointer.VertSize = 4; //} return(pointsSeries); }
/// <summary> /// Creates a new graph with a 1 to 1 graph space with absolute layout /// </summary> public GraphView() { CanFocus = true; AxisX = new HorizontalAxis(); AxisY = new VerticalAxis(); }
void LogYWindow_Loaded(object sender, RoutedEventArgs e) { ChartPlotter plotter = new ChartPlotter(); plotter.Children.Add(new CursorCoordinateGraph()); plotter.DataTransform = new Log10YTransform(); VerticalAxis axis = new VerticalAxis { TicksProvider = new LogarithmNumericTicksProvider(10), LabelProvider = new UnroundingLabelProvider() }; plotter.MainVerticalAxis = axis; plotter.AxisGrid.DrawVerticalMinorTicks = true; const int count = 500; double[] xs = Enumerable.Range(1, count).Select(x => x * 0.01).ToArray(); EnumerableDataSource <double> xDS = xs.AsXDataSource(); var pows = xs.Select(x => Math.Pow(10, x)); var linear = xs.Select(x => x); var logXs = Enumerable.Range(101, count).Select(x => x * 0.01); var logarithmic = logXs.Select(x => Math.Log10(x)); plotter.AddLineGraph(pows.AsYDataSource().Join(xDS), "f(x) = 10^x"); plotter.AddLineGraph(linear.AsYDataSource().Join(xDS), "f(x) = x"); plotter.AddLineGraph(logarithmic.AsYDataSource().Join(logXs.AsXDataSource()), "f(x) = log(x)"); Content = plotter; }
protected override PointF[] CalculatePoints() { double maxX = HorizontalAxis.Transform(HorizontalAxis.Maximum); double DX = HorizontalAxis.Transform(HorizontalAxis.Minimum + dX) - HorizontalAxis.Transform(HorizontalAxis.Minimum); int start = 0; if (minX < HorizontalAxis.Minimum) { start = (int)Math.Floor((HorizontalAxis.Minimum - minX) / dX); } if (start >= Y.Length) { start = Y.Length - 1; } List <PointF> pointList = new List <PointF>(); double prevX = HorizontalAxis.Transform(X0 + start * dX); double prevY = VerticalAxis.Transform(Y[start]); pointList.Add(new PointF((float)prevX, (float)prevY)); double curX = prevX; double curY; for (int i = start + 1; i < Y.Length && ((DX > 0 && curX <= maxX) || (DX < 0 && curX >= maxX)); i++) { curX += DX; curY = VerticalAxis.Transform(Y[i]); if (curX - prevX > 1.5 || curY - prevY > 1.5 || prevX - curX > 1.5 || prevY - curY > 1.5) { prevX = curX; prevY = curY; pointList.Add(new PointF((float)prevX, (float)prevY)); } } return(pointList.ToArray()); }
void CalculateVerticalAxisScalers() { if (VerticalAxis != null) { VerticalAxis.Recalculate(); } }
/// <summary> /// Updates the <see cref="BaseUbiIniGameConfigViewModel{Handler}.ConfigData"/> /// </summary> /// <returns>The task</returns> protected override Task UpdateConfigAsync() { ConfigData.GLI_Mode = new RayGLI_Mode() { ColorMode = IsTextures32Bit ? 32 : 16, IsWindowed = !FullscreenMode, ResX = ResX, ResY = ResY }.ToString(); ConfigData.FormattedTriLinear = TriLinear; ConfigData.FormattedTnL = TnL; ConfigData.FormattedTexturesCompressed = CompressedTextures; ConfigData.Video_WantedQuality = VideoQuality.ToString(); ConfigData.FormattedVideo_AutoAdjustQuality = AutoVideoQuality; ConfigData.Video_BPP = IsVideo32Bpp ? "32" : "16"; ConfigData.Language = CurrentLanguage.ToString(); ConfigData.FormattedDynamicShadows = DynamicShadows; ConfigData.FormattedStaticShadows = StaticShadows; ConfigData.Camera_VerticalAxis = VerticalAxis.ToString(); ConfigData.Camera_HorizontalAxis = HorizontalAxis.ToString(); ConfigData.TexturesFile = $"Tex{(IsTextures32Bit ? 32 : 16)}.cnt"; return(Task.CompletedTask); }
private void Control_OnMouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { var pos = e.GetPosition(this); if (_lastMovePosition == new Point()) { _lastMovePosition = pos; } var d = pos.Y - _lastMovePosition.Y; _lastMovePosition = pos; var r = ViewportModelRect; var y = VerticalAxis.ClientToModel(VerticalAxis.ModelToClient(r.Y) - d); if (VerticalAxis is Log10Axis) { r.Height *= y / r.Y; } r.Y = y; if (!double.IsNaN(r.X) && !double.IsNaN(r.Y) && !double.IsNaN(r.Width) && !double.IsNaN(r.Height)) { ViewportModelRect = r; } } else { _lastMovePosition = new Point(); } }
public HighLow AddHighLowSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis, Color p_seriesColor, bool p_IsDateTime, bool p_showInLegend) { Steema.TeeChart.Styles.HighLow highLowSeries = new Steema.TeeChart.Styles.HighLow(); objChart.Series.Add(highLowSeries); highLowSeries.VertAxis = p_VertAxis; highLowSeries.XValues.DateTime = p_IsDateTime; highLowSeries.Title = p_SeriesName; highLowSeries.Marks.Visible = false; highLowSeries.ShowInLegend = p_showInLegend; highLowSeries.Color = p_seriesColor; highLowSeries.HighPen.Visible = false; highLowSeries.LowPen.Visible = false; highLowSeries.Pen.Visible = false; highLowSeries.HighBrush.Color = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(0)), ((System.Byte)(192)), ((System.Byte)(0))); highLowSeries.HighBrush.Visible = true; highLowSeries.LowBrush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128))); highLowSeries.LowBrush.Visible = true; highLowSeries.HighBrush.Transparency = 50; highLowSeries.HighBrush.Solid = true; highLowSeries.LowBrush.Transparency = 50; highLowSeries.LowBrush.Solid = true; return(highLowSeries); }
private void Window_Loaded(object sender, RoutedEventArgs e) { // Create first source source1 = new ObservableDataSource <Tuple <double, double> >(); source1.SetXYMapping(z => { Point p = new Point(z.Item1, z.Item2); return(p); }); HorizontalAxis axis = (HorizontalAxis)plotter.MainHorizontalAxis; //axis.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######E+0")); axis.LabelProvider.SetCustomFormatter(info => StringUtils.CodeString(info.Tick)); VerticalAxis axis2 = (VerticalAxis)plotter.MainVerticalAxis; //axis.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######E+0")); axis2.LabelProvider.SetCustomFormatter(info => StringUtils.CodeString(info.Tick)); Random rnd = new Random(); for (int i = 0; i < 50; i++) { source1.Collection.Add(new Tuple <double, double>(i, rnd.Next(100))); //sourcevoltage.Collection.Add(new Tuple<double, double>(i, 10 + rnd.Next(20))); } linegraph.DataSource = source1; }
public Line AddLineSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis, Color p_seriesColor, bool p_IsDateTime, bool p_showInLegend, bool pointVisible, System.Drawing.Drawing2D.DashStyle p_lineStyle, int p_lineWidth) { Steema.TeeChart.Styles.Line lineSeries = new Steema.TeeChart.Styles.Line(); objChart.Series.Add(lineSeries); lineSeries.VertAxis = p_VertAxis; lineSeries.XValues.DateTime = p_IsDateTime; lineSeries.Title = p_SeriesName; lineSeries.Marks.Visible = false; lineSeries.ShowInLegend = p_showInLegend; lineSeries.Color = p_seriesColor; // Line-Point Display lineSeries.Pointer.Visible = pointVisible; lineSeries.Pointer.Style = PointerStyles.Circle; lineSeries.Pointer.Pen.Visible = false; lineSeries.Pointer.HorizSize = 3; lineSeries.Pointer.VertSize = 3; lineSeries.LinePen.Style = p_lineStyle; lineSeries.LinePen.Width = p_lineWidth; return(lineSeries); }
void OnVerticalAxisChanged(DependencyPropertyChangedEventArgs args) { if (VerticalAxis != null) { VerticalAxis.Parent = this; VerticalAxis.PointProperty = "Y"; VerticalAxis.Recalculate(); } }
public VerticalAxisPanel(VerticalAxis axis) : this() { mAxis = axis; wPanel.Value = axis.W; hPanel.Value = axis.H; paddingHPanel.Value = axis.PaddingH; paddingVPanel.Value = axis.PaddingV; constrainedAxisPanel.Axis = axis; }
public void VerticalAxisTest() { ChartPlotter plotter = new ChartPlotter(); var expected = new VerticalAxis(); GeneralAxis actual; plotter.MainVerticalAxis = expected; actual = plotter.MainVerticalAxis; Assert.AreEqual(expected, actual); }
/// <summary> /// Gantt series를 초기화 합니다. /// </summary> /// <param name="ganttSeries"></param> /// <param name="IsViewPen"></param> public static void InitGanttSeries(Gantt ganttSeries, VerticalAxis Yaxis, string seriesTitle, bool boolTime, bool IsViewPen) { ganttSeries.Marks.Visible = false; ganttSeries.Pointer.Pen.Visible = IsViewPen; ganttSeries.ColorEach = false; ganttSeries.Title = seriesTitle; ganttSeries.VertAxis = Yaxis; ganttSeries.XValues.DateTime = boolTime; }
private void ConfigureYAxisRight(ChartPlotter plotter) { yAxisRight = new VerticalAxis() { Placement = AxisPlacement.Right }; plotter.Children.Add(yAxisRight); yAxisRight.ConvertFromDouble = s => (s + .5) * 500.0; yAxisRight.ConvertToDouble = s => s / 500.0 - .5; }
private double GetClientY(double model) { var client = (_cachedScale.Y * (VerticalAxis.ViewToHomogenous(model) - VerticalAxis.ViewToHomogenous(_boundsRect.Top))); if (VerticalAxis.IsReversed) { return(_canvas.ActualHeight - client); } return(client + 0); }
private void CacheTransform() { if (HorizontalAxis == null || VerticalAxis == null) { return; } var scaleX = _canvas.ActualWidth / (HorizontalAxis.ViewToHomogenous(_boundsRect.Right) - HorizontalAxis.ViewToHomogenous(_boundsRect.Left)); var scaleY = _canvas.ActualHeight / (VerticalAxis.ViewToHomogenous(_boundsRect.Bottom) - HorizontalAxis.ViewToHomogenous(_boundsRect.Top)); _cachedScale = new Point(scaleX, scaleY); }
void IData.Draw(Graphics g, RectangleF plotRectangle) { if (points.Length > 1) { if (BarStyle != BarStyle.None) { if (BarFillColor.A > 0) { g.FillRectangles(new SolidBrush(BarFillColor), bars); } if (BarLineColor.A > 0) { g.DrawRectangles(new Pen(BarLineColor), bars); } } if (FillStyle != FillStyle.None) { GraphicsPath fillPath = new GraphicsPath(); if (FillStyle == FillStyle.ToNInfitity) { fillPath.AddPath(GraphicsPath, true); fillPath.AddLine(points[0].X, points[0].Y, points[0].X, plotRectangle.Bottom); fillPath.AddLine(points[0].X, plotRectangle.Bottom, points[points.Length - 1].X, plotRectangle.Bottom); fillPath.AddLine(points[points.Length - 1].X, plotRectangle.Bottom, points[points.Length - 1].X, points[points.Length - 1].Y); } else if (FillStyle == FillStyle.ToPInfinity) { fillPath.AddPath(GraphicsPath, true); fillPath.AddLine(points[0].X, points[0].Y, points[0].X, plotRectangle.Top); fillPath.AddLine(points[0].X, plotRectangle.Top, points[points.Length - 1].X, plotRectangle.Top); fillPath.AddLine(points[points.Length - 1].X, plotRectangle.Top, points[points.Length - 1].X, points[points.Length - 1].Y); } else if (FillStyle == FillStyle.ToValue) { float fillValue = (float)VerticalAxis.Transform(FillValue); fillPath.AddPath(GraphicsPath, true); fillPath.AddLine(points[0].X, points[0].Y, points[0].X, fillValue); fillPath.AddLine(points[0].X, fillValue, points[points.Length - 1].X, fillValue); fillPath.AddLine(points[points.Length - 1].X, fillValue, points[points.Length - 1].X, points[points.Length - 1].Y); } else if (FillStyle == FillStyle.ToPlot && FillPlot != null) { fillPath.AddPath(GraphicsPath, true); fillPath.Reverse(); fillPath.AddPath(FillPlot.GraphicsPath, true); } g.FillPath(new SolidBrush(FillColor), fillPath); fillPath.Flatten(); flattenFill = fillPath.PathPoints; } Line.DrawPath(g, LineColor, LineStyle, LineWidth, GraphicsPath); Marker.Draw(g, MarkColor, MarkStyle, MarkSize, points); } }
/// <summary> /// PIE series를 초기화합니다. /// </summary> /// <param name="pieSeries"></param> /// <param name="Yaxis"></param> /// <param name="seriesName"></param> public static void InitPieSeries(Pie pieSeries, VerticalAxis Yaxis, string seriesName) { pieSeries.VertAxis = Yaxis; pieSeries.XValues.DateTime = false; pieSeries.Title = seriesName; pieSeries.Marks.Visible = false; pieSeries.ColorEach = false; //pieSeries.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(153)), ((System.Byte)(153))); //pieSeries.Pen.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(128))); }
/// <summary> /// line series 초기화를 합니다. /// </summary> /// <param name="lineSeries"></param> /// <param name="IsViewPoint"></param> public static void InitLineSeries(Line lineSeries, VerticalAxis Yaxis, string seriesTitle, bool boolTime, bool IsViewPoint) { lineSeries.Pointer.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); lineSeries.Pointer.HorizSize = 3; lineSeries.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle; lineSeries.Pointer.VertSize = 3; lineSeries.Pointer.Visible = IsViewPoint; lineSeries.Title = seriesTitle; lineSeries.VertAxis = Yaxis; lineSeries.XValues.DateTime = boolTime; }
public void VerticalAxisTest() { ChartPlotter plotter = new ChartPlotter(); var expected = new VerticalAxis(); GeneralAxis actual; plotter.MainVerticalAxis = expected; actual = plotter.MainVerticalAxis; Assert.AreEqual(expected, actual); Assert.IsTrue(plotter.Children.OfType <VerticalAxis>().Count() == 1); }
private void ConfigureYAxisLeft(ChartPlotter plotter) { yAxisLeft = new VerticalAxis { TicksProvider = new LogarithmNumericTicksProvider(10), LabelProvider = new UnroundingLabelProvider(), ConvertFromDouble = t => Math.Pow(10.0, t), ConvertToDouble = s => Math.Log10(s) }; plotter.MainVerticalAxis = yAxisLeft; plotter.AxisGrid.DrawVerticalMinorTicks = true; }
public Window1() { InitializeComponent(); VerticalAxis axis = new VerticalAxis(); axis.SetConversion(0, 100, 100, 0); plotter.Children.Add(axis); // this is only an example of visible rectange. Use here rect you actually need. plotter.Viewport.Visible = new Rect(0, 0, 1, 100); }
/// <summary> /// /// </summary> /// <param name="horizBarSeries"></param> /// <param name="Yaxis"></param> /// <param name="seriesName"></param> public static void InitHorizBarSeries(HorizBar horizBarSeries, VerticalAxis Yaxis, string seriesName) { // Axis 관련 항목 horizBarSeries.BarStyle = Steema.TeeChart.Styles.BarStyles.Cylinder; horizBarSeries.Pen.Visible = false; horizBarSeries.ColorEach = true; horizBarSeries.VertAxis = Yaxis; horizBarSeries.XValues.DateTime = false; horizBarSeries.Title = seriesName; horizBarSeries.Marks.Visible = false; }
public virtual double GetModelY(double client) { if (VerticalAxis.IsReversed) { client = _canvas.ActualHeight - client; } else { client = client - 0; } return(VerticalAxis.HomogenousToView((client) / _cachedScale.Y + VerticalAxis.ViewToHomogenous(_boundsRect.Top))); }
public Coordinate(string coord) { try { VerticalPoint = (VerticalAxis)Enum.Parse(typeof(VerticalAxis), coord.Substring(0, 1).ToUpper());; HorizontalPoint = Convert.ToInt32(coord.Substring(1)); } catch { throw new FormatException("Invalid Format"); } }
/// <summary> /// Points series를 초기화합니다. /// </summary> /// <param name="pointSeries"></param> /// <param name="Yaxis"></param> /// <param name="seriesName"></param> public static void InitPointsSeries(Points pointSeries, VerticalAxis Yaxis, string seriesName) { pointSeries.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Sphere; pointSeries.Pointer.HorizSize = 1; pointSeries.Pointer.VertSize = 4; //pointSeries.Color = color; pointSeries.Pointer.Visible = true; pointSeries.Pointer.Pen.Color = Color.Red; pointSeries.Pointer.Pen.Width = 3; pointSeries.Title = seriesName; pointSeries.VertAxis = Yaxis; }
public Histogram AddHistogramSeries(string seriesName, VerticalAxis vertAxis, Color seriesColor) { Steema.TeeChart.Styles.Histogram histogramSeries = new Histogram(); histogramSeries.VertAxis = vertAxis; histogramSeries.XValues.DateTime = this.IsDateTime; histogramSeries.Title = seriesName; histogramSeries.Marks.Visible = false; histogramSeries.ShowInLegend = this.IsShowInLegend; histogramSeries.Color = seriesColor; histogramSeries.LinePen.Visible = false; return(histogramSeries); }
public void ChangeSeriesType(TChart objChart) { int SeriesCount = 0; for (int index1 = 0; index1 < objChart.Series.Count; index1++) { if (objChart.Series[index1].ShowInLegend == true) { if (objChart.Series[index1].GetType() == typeof(Line)) { if (!((Line)objChart.Series[index1]).Pointer.Visible) // Line Type의 Point가 Visible False일 경우 { ((Line)objChart.Series[index1]).ColorEachLine = false; ((Line)objChart.Series[index1]).Pointer.Visible = true; ((Line)objChart.Series[index1]).Pointer.HorizSize = 2; ((Line)objChart.Series[index1]).Pointer.VertSize = 2; ((Line)objChart.Series[index1]).Pointer.Pen.Color = this.GetSeriesColor(SeriesCount); ((Line)objChart.Series[index1]).Pointer.Pen.Width = 1; ((Line)objChart.Series[index1]).Pointer.Brush.Color = this.GetSeriesColor(SeriesCount); } else { Steema.TeeChart.Styles.Points pointSeries = new Points(); Steema.TeeChart.Styles.Series series = objChart.Series[index1]; Steema.TeeChart.Styles.Series.ChangeType(ref series, pointSeries.GetType()); ((Points)series).Pointer.Visible = true; ((Points)series).Pointer.HorizSize = 2; ((Points)series).Pointer.VertSize = 2; ((Points)series).Pointer.Pen.Color = this.GetSeriesColor(SeriesCount); ((Points)series).Pointer.Pen.Width = 1; ((Points)series).Pointer.Brush.Color = this.GetSeriesColor(SeriesCount); } } else if (objChart.Series[index1].GetType() == typeof(Points)) { Steema.TeeChart.Styles.Line lineSeriees = new Line(); Steema.TeeChart.Styles.Series series = objChart.Series[index1]; VerticalAxis oriaxis = series.VertAxis; Steema.TeeChart.Styles.Series.ChangeType(ref series, lineSeriees.GetType()); ((Line)objChart.Series[index1]).Color = GetSeriesColor(SeriesCount); ((Line)objChart.Series[index1]).ColorEachLine = false; ((Line)objChart.Series[index1]).Pointer.Visible = false; } SeriesCount++; } } }
public Bar AddVertBarSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis, Color p_seriesColor, bool p_EachColor, bool p_showInLegend) { Steema.TeeChart.Styles.Bar vertBar = new Bar(); objChart.Series.Add(vertBar); vertBar.VertAxis = p_VertAxis; vertBar.Title = p_SeriesName; vertBar.BarStyle = Steema.TeeChart.Styles.BarStyles.Cylinder; vertBar.Pen.Visible = false; vertBar.ColorEach = p_EachColor; vertBar.Marks.Visible = false; return(vertBar); }