internal static void SetNPlotSurfaceDefaultBackColor(Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface) { if (plotSurface == null) { return; } plotSurface.ClientBackColor = NPlotSurface_BackColor_Default; plotSurface.TitleColor = NPlotSurface_Label_Default; if (plotSurface.XAxis1 != null) { plotSurface.XAxis1.AxisColor = NPlotSurface_AxisColor_Default; plotSurface.XAxis1.TickTextColor = NPlotSurface_TickTextColor_Default; plotSurface.XAxis1.LabelColor = NPlotSurface_Label_Default; } if (plotSurface.YAxis1 != null) { plotSurface.YAxis1.AxisColor = NPlotSurface_AxisColor_Default; plotSurface.YAxis1.TickTextColor = NPlotSurface_TickTextColor_Default; plotSurface.YAxis1.LabelColor = NPlotSurface_Label_Default; } }
internal static Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl Create_NPlotSurface(Alt.GUI.Temporary.Gwen.Control.Base parent) { Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface = new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl(parent); plotSurface.AutoScaleAutoGeneratedAxes = false; plotSurface.AutoScaleTitle = false; plotSurface.DateTimeToolTip = false; plotSurface.Legend = null; plotSurface.LegendZOrder = -1; plotSurface.Name = "plotSurface"; plotSurface.RightMenu = null; plotSurface.ShowCoordinates = false; plotSurface.SmoothingMode = SmoothingMode.AntiAlias; // None; plotSurface.SurfacePadding = 10; plotSurface.Title = ""; plotSurface.TitleFont = new Alt.Sketch.Font("Arial", 14F, Alt.Sketch.FontStyle.Regular, GraphicsUnit.Pixel); plotSurface.XAxis1 = null; plotSurface.XAxis2 = null; plotSurface.YAxis1 = null; plotSurface.YAxis2 = null; SetNPlotSurfaceDefaultBackColor(plotSurface); return(plotSurface); }
public void SetPlotBackColor(Alt.Sketch.Color color) { Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface = PlotSurface; if (plotSurface == null) { return; } plotSurface.ClientBackColor = color; }
public void SetPlotDefaultBackColor() { Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface = PlotSurface; if (plotSurface == null) { return; } AltGUIHelper.SetNPlotSurfaceDefaultBackColor(plotSurface); }
/// <summary> /// Constructor /// </summary> public ReducedContextMenu(Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface2D) : base(plotSurface2D) { ArrayList menuItems = MenuItems; // remove show coordinates, and print functionality menuItems.RemoveAt(1); SetMenuItems(menuItems); }
protected void Start(Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface) { if (plotSurface == null) { return; } plotSurface.Clear(); PlotDataSet(plotSurface.Inner); plotSurface.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.HorizontalDrag()); plotSurface.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.VerticalDrag()); plotSurface.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.AxisDrag(true)); plotSurface.Refresh(); AltGUIHelper.SetNPlotSurfaceDefaultBackColor(plotSurface); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); costPS = new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl(this); costPS.AutoScaleAutoGeneratedAxes = false; costPS.AutoScaleTitle = false; costPS.DateTimeToolTip = false; costPS.Legend = null; costPS.LegendZOrder = -1; costPS.Location = new PointI(13, 13); costPS.Name = "costPS"; costPS.RightMenu = null; costPS.ShowCoordinates = false; costPS.Size = new SizeI(606, 285); costPS.SmoothingMode = SmoothingMode.None; costPS.SurfacePadding = 10; costPS.Title = ""; costPS.TitleFont = new Font("Arial", 14F, FontStyle.Regular, GraphicsUnit.Pixel); costPS.XAxis1 = null; costPS.XAxis2 = null; costPS.YAxis1 = null; costPS.YAxis2 = null; volumePS = new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl(this); volumePS.AutoScaleAutoGeneratedAxes = false; volumePS.AutoScaleTitle = false; volumePS.DateTimeToolTip = false; volumePS.Legend = null; volumePS.LegendZOrder = -1; volumePS.Location = new PointI(13, 305); volumePS.Name = "volumePS"; volumePS.RightMenu = null; volumePS.ShowCoordinates = false; volumePS.Size = new SizeI(606, 109); volumePS.SmoothingMode = SmoothingMode.None; volumePS.SurfacePadding = 10; volumePS.Title = ""; volumePS.TitleFont = new Font("Arial", 14F, FontStyle.Regular, GraphicsUnit.Pixel); volumePS.XAxis1 = null; volumePS.XAxis2 = null; volumePS.YAxis1 = null; volumePS.YAxis2 = null; volumePS.Dock = Pos.Bottom; costPS.Dock = Pos.Fill; Padding = new Alt.GUI.Temporary.Gwen.Padding(20); costPS.Clear(); costPS.DateTimeToolTip = true; // obtain stock information from xml file DataSet ds = new DataSet(); System.IO.Stream file = Alt.IO.VirtualFile.OpenRead("AltData/NPlot/asx_jbh.xml"); ds.ReadXml(file, XmlReadMode.ReadSchema); DataTable dt = ds.Tables[0]; //NoNeed DataView dv = new DataView(dt); // create CandlePlot. CandlePlot cp = new CandlePlot(); cp.DataSource = dt; cp.AbscissaData = "Date"; cp.OpenData = "Open"; cp.LowData = "Low"; cp.HighData = "High"; cp.CloseData = "Close"; cp.BearishColor = Color.Red; cp.BullishColor = Color.Green; cp.Style = CandlePlot.Styles.Filled; costPS.SmoothingMode = SmoothingMode.AntiAlias; costPS.Add(new Grid()); costPS.Add(cp); costPS.Title = "AU:JBH"; costPS.YAxis1.Label = "Price [$]"; costPS.YAxis1.LabelOffset = 40; costPS.YAxis1.LabelOffsetAbsolute = true; costPS.XAxis1.HideTickText = true; costPS.SurfacePadding = 5; costPS.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.HorizontalDrag()); costPS.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.VerticalDrag()); costPS.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.AxisDrag(false)); costPS.InteractionOccured += new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.InteractionHandler(costPS_InteractionOccured); costPS.AddAxesConstraint(new AxesConstraint.AxisPosition(PlotSurface2D.YAxisPosition.Left, 60)); PointPlot pp = new PointPlot(); pp.Marker = new Marker(Marker.MarkerType.Square, 0); pp.Marker.Pen = new Pen(Color.Red, 5.0f); pp.Marker.DropLine = true; pp.DataSource = dt; pp.AbscissaData = "Date"; pp.OrdinateData = "Volume"; volumePS.Add(pp); volumePS.YAxis1.Label = "Volume"; volumePS.YAxis1.LabelOffsetAbsolute = true; volumePS.YAxis1.LabelOffset = 40; volumePS.SurfacePadding = 5; volumePS.AddAxesConstraint(new AxesConstraint.AxisPosition(PlotSurface2D.YAxisPosition.Left, 60)); volumePS.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.AxisDrag(false)); volumePS.AddInteraction(new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.Interactions.HorizontalDrag()); volumePS.InteractionOccured += new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.InteractionHandler(volumePS_InteractionOccured); volumePS.PreRefresh += new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl.PreRefreshHandler(volumePS_PreRefresh); costPS.RightMenu = new ReducedContextMenu(costPS); SetPlotBackColor(); UpdateSize(); }