/// <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> /// 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); }