/// <summary> /// Creates a brand new graph which has an x-y plot layer. The graph is not named, nor is it already part of the project. /// </summary> /// <param name="propertyContext">The property context. Can be retrieved for instance from the table the plot is initiated or the folder.</param> /// <returns>The created graph.</returns> private static GraphDocument CreateBuiltinGraph(IReadOnlyPropertyBag propertyContext) { if (null == propertyContext) { propertyContext = PropertyExtensions.GetPropertyContextOfProject(); } var graph = new Altaxo.Graph.Gdi.GraphDocument(); TemplateBase.AddStandardPropertiesToGraph(graph, propertyContext); graph.RootLayer.Location.CopyFrom(propertyContext.GetValue(Altaxo.Graph.Gdi.GraphDocument.PropertyKeyDefaultRootLayerSize)); // apply the default location from the property in the path var layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.RootLayer, new Altaxo.Graph.Gdi.CS.G2DPolarCoordinateSystem()); layer.Scales[0] = new Scales.AngularDegreeScale() { TickSpacing = new Scales.Ticks.AngularDegreeTickSpacing() }; layer.CreateDefaultAxes(propertyContext); layer.AxisStyles[CSLineID.X1].AxisLineStyle.FirstDownMajorTicks = false; layer.AxisStyles[CSLineID.X1].AxisLineStyle.FirstDownMinorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMinorTicks = false; graph.RootLayer.Layers.Add(layer); return(graph); }
/// <summary> /// Plots the currently selected data columns of a worksheet. /// </summary> /// <param name="dg">The worksheet controller where the columns are selected in.</param> public static void PlotLinePolar(GUI.WorksheetController dg) { Altaxo.Graph.Gdi.GraphDocument graph = new Altaxo.Graph.Gdi.GraphDocument(); Altaxo.Graph.Gdi.XYPlotLayer layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.DefaultLayerPosition, graph.DefaultLayerSize, new Altaxo.Graph.Gdi.CS.G2DPolarCoordinateSystem()); layer.CreateDefaultAxes(); graph.Layers.Add(layer); Current.Project.GraphDocumentCollection.Add(graph); IGraphController gc = Plot(dg.DataTable, dg.SelectedDataColumns, graph, PlotStyle_Line, GroupStyle_Color_Line); }
/// <summary> /// Plots selected data columns of a table. /// </summary> /// <param name="table">The source table.</param> /// <param name="selectedColumns">The data columns of the table that should be plotted.</param> /// <param name="templatePlotStyle">The plot style which is the template for all plot items.</param> /// <param name="groupStyles">The group styles for the newly built plot item collection.</param> public static IGraphController Plot(DataTable table, IAscendingIntegerCollection selectedColumns, G2DPlotStyleCollection templatePlotStyle, PlotGroupStyleCollection groupStyles) { Altaxo.Graph.Gdi.GraphDocument graph = new Altaxo.Graph.Gdi.GraphDocument(); Altaxo.Graph.Gdi.XYPlotLayer layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.DefaultLayerPosition, graph.DefaultLayerSize); layer.CreateDefaultAxes(); graph.Layers.Add(layer); Current.Project.GraphDocumentCollection.Add(graph); return(Plot(table, selectedColumns, graph, templatePlotStyle, groupStyles)); }
/// <summary> /// Creates a brand new graph which has an x-y plot layer. The graph is not named, nor is it already part of the project. /// </summary> /// <param name="propertyContext">The property context. Can be retrieved for instance from the table the plot is initiated or the folder.</param> /// <returns>The created graph.</returns> private static GraphDocument CreateBuiltinGraph(IReadOnlyPropertyBag propertyContext) { if (null == propertyContext) propertyContext = PropertyExtensions.GetPropertyContextOfProject(); var graph = new GraphDocument(); TemplateBase.AddStandardPropertiesToGraph(graph, propertyContext); // apply the default location from the property in the path graph.RootLayer.Location.CopyFrom(propertyContext.GetValue(Altaxo.Graph.Gdi.GraphDocument.PropertyKeyDefaultRootLayerSize)); Altaxo.Graph.Gdi.XYPlotLayer layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.RootLayer); layer.CreateDefaultAxes(propertyContext); layer.AxisStyles[CSLineID.X0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.X0].AxisLineStyle.FirstUpMinorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMinorTicks = false; graph.RootLayer.Layers.Add(layer); return graph; }
/// <summary> /// Creates a brand new graph which has an x-y plot layer. The graph is not named, nor is it already part of the project. /// </summary> /// <param name="propertyContext">The property context. Can be retrieved for instance from the table the plot is initiated or the folder.</param> /// <returns>The created graph.</returns> private static GraphDocument CreateBuiltinGraph(IReadOnlyPropertyBag propertyContext) { if (null == propertyContext) propertyContext = PropertyExtensions.GetPropertyContextOfProject(); Altaxo.Graph.Gdi.GraphDocument graph = new Altaxo.Graph.Gdi.GraphDocument(); TemplateBase.AddStandardPropertiesToGraph(graph, propertyContext); graph.RootLayer.Location.CopyFrom(propertyContext.GetValue(Altaxo.Graph.Gdi.GraphDocument.PropertyKeyDefaultRootLayerSize)); // apply the default location from the property in the path Altaxo.Graph.Gdi.XYPlotLayer layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.RootLayer, new Altaxo.Graph.Gdi.CS.G2DPolarCoordinateSystem()); layer.Scales[0] = new Scales.AngularDegreeScale() { TickSpacing = new Scales.Ticks.AngularDegreeTickSpacing() }; layer.CreateDefaultAxes(propertyContext); layer.AxisStyles[CSLineID.X1].AxisLineStyle.FirstDownMajorTicks = false; layer.AxisStyles[CSLineID.X1].AxisLineStyle.FirstDownMinorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMinorTicks = false; graph.RootLayer.Layers.Add(layer); return graph; }
/// <summary> /// Creates a brand new graph which has an x-y plot layer. The graph is not named, nor is it already part of the project. /// </summary> /// <param name="propertyContext">The property context. Can be retrieved for instance from the table the plot is initiated or the folder.</param> /// <returns>The created graph.</returns> private static GraphDocument CreateBuiltinGraph(IReadOnlyPropertyBag propertyContext) { if (null == propertyContext) { propertyContext = PropertyExtensions.GetPropertyContextOfProject(); } var graph = new GraphDocument(); TemplateBase.AddStandardPropertiesToGraph(graph, propertyContext); // apply the default location from the property in the path graph.RootLayer.Location.CopyFrom(propertyContext.GetValue(Altaxo.Graph.Gdi.GraphDocument.PropertyKeyDefaultRootLayerSize)); var layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.RootLayer); layer.CreateDefaultAxes(propertyContext); layer.AxisStyles[CSLineID.X0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.X0].AxisLineStyle.FirstUpMinorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMajorTicks = false; layer.AxisStyles[CSLineID.Y0].AxisLineStyle.FirstUpMinorTicks = false; graph.RootLayer.Layers.Add(layer); return(graph); }