public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (AnnotationPosition != null) { hashCode = hashCode * 59 + AnnotationPosition.GetHashCode(); } if (AnnotationTail != null) { hashCode = hashCode * 59 + AnnotationTail.GetHashCode(); } if (AnnotationText != null) { hashCode = hashCode * 59 + AnnotationText.GetHashCode(); } if (AxisTitleText != null) { hashCode = hashCode * 59 + AxisTitleText.GetHashCode(); } if (ColorbarPosition != null) { hashCode = hashCode * 59 + ColorbarPosition.GetHashCode(); } if (ColorbarTitleText != null) { hashCode = hashCode * 59 + ColorbarTitleText.GetHashCode(); } if (LegendPosition != null) { hashCode = hashCode * 59 + LegendPosition.GetHashCode(); } if (LegendText != null) { hashCode = hashCode * 59 + LegendText.GetHashCode(); } if (ShapePosition != null) { hashCode = hashCode * 59 + ShapePosition.GetHashCode(); } if (TitleText != null) { hashCode = hashCode * 59 + TitleText.GetHashCode(); } return(hashCode); } }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = (o == null ? new XYPlotLayer(info) : (XYPlotLayer)o); int count; // size, position, rotation and scale var location = (XYPlotLayerPositionAndSize_V0)info.GetValue("LocationAndSize", s); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); s.Location = location.ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // CoordinateSystem s.CoordinateSystem = (G2DCoordinateSystem)info.GetValue("CoordinateSystem", s); s.CoordinateSystem.UpdateAreaSize(s._cachedLayerSize); // linked layers count = info.OpenArray("LinkedLayers"); var linkedLayer = (Main.RelDocNodeProxy)info.GetValue("e", s); info.CloseArray(count); // Scales var linkedScales = (Altaxo.Graph.Scales.Deprecated.LinkedScaleCollection)info.GetValue("Scales", s); s.SetupOldAxes(linkedScales); ProvideLinkedScalesWithLinkedLayerIndex(s, linkedLayer, info); // Grid planes s.GridPlanes = (GridPlaneCollection)info.GetValue("GridPlanes", s); // Axis Styles s.AxisStyles = (AxisStyleCollection)info.GetValue("AxisStyles", s); // Legends var legends = (IList <IGraphicBase>)info.GetValue("Legends", s); // Graphic objects s.GraphObjects.AddRange((IEnumerable <IGraphicBase>)info.GetValue("GraphObjects", s)); foreach (var item in legends) { if (item is TextGraphic) { var l = new LegendText((TextGraphic)item); s.GraphObjects.Add(l); } } // Data Clipping s.ClipDataToFrame = (LayerDataClipping)info.GetValue("DataClipping", s); // PlotItemCollection s.PlotItems = (PlotItemCollection)info.GetValue("Plots", s); return(s); }
/// <summary> /// Display a new text /// in the legend. /// </summary> /// <param name="text">string - text to display</param> /// <param name="type">string - optional - text type. Type defines the text layout</param> public void AddText(string text, string type = "standard") { // instantiate text on children position. GameObject addedText = Instantiate(textModel, transform.position, transform.rotation, this.transform); // update text values. LegendText textClass = addedText.GetComponent <LegendText>(); textClass.UpdateText(text); // update text color if required by type. if (type != "standard") { // text for golden apple collectible. if (type == "golden") { textClass.SetTextColor(colors[0]); } } }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = (o == null ? new XYPlotLayer(info) : (XYPlotLayer)o); int count; // size, position, rotation and scale var location = (XYPlotLayerPositionAndSize_V0)info.GetValue("LocationAndSize", s); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); s.Location = location.ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // CoordinateSystem s.CoordinateSystem = (G2DCoordinateSystem)info.GetValue("CoordinateSystem", s); s.CoordinateSystem.UpdateAreaSize(s._cachedLayerSize); // linked layers count = info.OpenArray("LinkedLayers"); var linkedLayer = (Main.RelDocNodeProxy)info.GetValue("e", s); info.CloseArray(count); // Scales s.Scales = (ScaleCollection)info.GetValue("Scales", s); ProvideLinkedScalesWithLinkedLayerIndex(s, linkedLayer, info); // Grid planes s.GridPlanes = (GridPlaneCollection)info.GetValue("GridPlanes", s); // Axis Styles s.AxisStyles = (AxisStyleCollection)info.GetValue("AxisStyles", s); // Legends var legends = (IList<IGraphicBase>)info.GetValue("Legends", s); // Graphic objects s.GraphObjects.AddRange((IEnumerable<IGraphicBase>)info.GetValue("GraphObjects", s)); foreach (var item in legends) { if (item is TextGraphic) { var l = new LegendText((TextGraphic)item); s.GraphObjects.Add(l); } } // Data Clipping s.ClipDataToFrame = (LayerDataClipping)info.GetValue("DataClipping", s); // PlotItemCollection s.PlotItems = (PlotItemCollection)info.GetValue("Plots", s); return s; }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = (o == null ? new XYPlotLayer(info) : (XYPlotLayer)o); int count; // Background IBackgroundStyle bgs = (IBackgroundStyle)info.GetValue("Background", s); if (null != bgs) { if (!s.GridPlanes.Contains(CSPlaneID.Front)) s.GridPlanes.Add(new GridPlane(CSPlaneID.Front)); s.GridPlanes[CSPlaneID.Front].Background = bgs.Brush; } // size, position, rotation and scale var location = (XYPlotLayerPositionAndSize_V0)info.GetValue("LocationAndSize", s); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); s._coordinateSystem.UpdateAreaSize(s._cachedLayerSize); s.Location = location.ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // LayerProperties bool clipDataToFrame = info.GetBoolean("ClipDataToFrame"); s._dataClipping = clipDataToFrame ? LayerDataClipping.StrictToCS : LayerDataClipping.None; // axis related var linkedScales = (Altaxo.Graph.Scales.Deprecated.LinkedScaleCollection)info.GetValue("AxisProperties", s); s.SetupOldAxes(linkedScales); // Styles G2DScaleStyleCollection ssc = (G2DScaleStyleCollection)info.GetValue("AxisStyles", s); GridPlane gplane = new GridPlane(CSPlaneID.Front); gplane.GridStyle[0] = ssc.ScaleStyle(0).GridStyle; gplane.GridStyle[1] = ssc.ScaleStyle(1).GridStyle; s.GridPlanes.Add(gplane); foreach (AxisStyle ax in ssc.AxisStyles) s._axisStyles.Add(ax); // Legends count = info.OpenArray("Legends"); var legend = (TextGraphic)info.GetValue("e", s); info.CloseArray(count); // XYPlotLayer specific count = info.OpenArray("LinkedLayers"); var linkedLayer = (Main.RelDocNodeProxy)info.GetValue("e", s); info.CloseArray(count); ProvideLinkedScalesWithLinkedLayerIndex(s, linkedLayer, info); s.GraphObjects.AddRange((IEnumerable<IGraphicBase>)info.GetValue("GraphicGlyphs", s)); if (null != legend) { var legend1 = new LegendText(legend); s.GraphObjects.Add(legend1); } s.PlotItems = (PlotItemCollection)info.GetValue("Plots", s); return s; }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = null != o ? (XYPlotLayer)o : new XYPlotLayer(info); bool fillLayerArea = info.GetBoolean("FillLayerArea"); BrushX layerAreaFillBrush = (BrushX)info.GetValue("LayerAreaFillBrush", s); if (fillLayerArea) { if (!s.GridPlanes.Contains(CSPlaneID.Front)) s.GridPlanes.Add(new GridPlane(CSPlaneID.Front)); s.GridPlanes[CSPlaneID.Front].Background = layerAreaFillBrush; } // size, position, rotation and scale var widthType = (XYPlotLayerSizeType)info.GetValue("WidthType", s); var heightType = (XYPlotLayerSizeType)info.GetValue("HeightType", s); var width = info.GetDouble("Width"); var height = info.GetDouble("Height"); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._coordinateSystem.UpdateAreaSize(s._cachedLayerSize); var xPositionType = (XYPlotLayerPositionType)info.GetValue("XPositionType", s); var yPositionType = (XYPlotLayerPositionType)info.GetValue("YPositionType", s); var xPosition = info.GetDouble("XPosition"); var yPosition = info.GetDouble("YPosition"); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); var rotation = info.GetSingle("Rotation"); var scale = info.GetSingle("Scale"); s.Location = new XYPlotLayerPositionAndSize_V0(widthType, width, heightType, height, xPositionType, xPosition, yPositionType, yPosition, rotation, scale).ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // axis related var xAxis = (Altaxo.Graph.Scales.Deprecated.Scale)info.GetValue("XAxis", s); var yAxis = (Altaxo.Graph.Scales.Deprecated.Scale)info.GetValue("YAxis", s); bool xIsLinked = info.GetBoolean("LinkXAxis"); bool yIsLinked = info.GetBoolean("LinkYAxis"); double xOrgA = info.GetDouble("LinkXAxisOrgA"); double xOrgB = info.GetDouble("LinkXAxisOrgB"); double xEndA = info.GetDouble("LinkXAxisEndA"); double xEndB = info.GetDouble("LinkXAxisEndB"); double yOrgA = info.GetDouble("LinkYAxisOrgA"); double yOrgB = info.GetDouble("LinkYAxisOrgB"); double yEndA = info.GetDouble("LinkYAxisEndA"); double yEndB = info.GetDouble("LinkYAxisEndB"); s.SetupOldAxis(0, xAxis, xIsLinked, xOrgA, xOrgB, xEndA, xEndB); s.SetupOldAxis(1, yAxis, yIsLinked, yOrgA, yOrgB, yEndA, yEndB); // Styles bool showLeft = info.GetBoolean("ShowLeftAxis"); bool showBottom = info.GetBoolean("ShowBottomAxis"); bool showRight = info.GetBoolean("ShowRightAxis"); bool showTop = info.GetBoolean("ShowTopAxis"); s._axisStyles.AxisStyleEnsured(CSLineID.Y0).AxisLineStyle = (AxisLineStyle)info.GetValue("LeftAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.X0).AxisLineStyle = (AxisLineStyle)info.GetValue("BottomAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.Y1).AxisLineStyle = (AxisLineStyle)info.GetValue("RightAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.X1).AxisLineStyle = (AxisLineStyle)info.GetValue("TopAxisStyle", s); s._axisStyles[CSLineID.Y0].MajorLabelStyle = (AxisLabelStyle)info.GetValue("LeftLabelStyle", s); s._axisStyles[CSLineID.X0].MajorLabelStyle = (AxisLabelStyle)info.GetValue("BottomLabelStyle", s); s._axisStyles[CSLineID.Y1].MajorLabelStyle = (AxisLabelStyle)info.GetValue("RightLabelStyle", s); s._axisStyles[CSLineID.X1].MajorLabelStyle = (AxisLabelStyle)info.GetValue("TopLabelStyle", s); // Titles and legend s._axisStyles[CSLineID.Y0].Title = (TextGraphic)info.GetValue("LeftAxisTitle", s); s._axisStyles[CSLineID.X0].Title = (TextGraphic)info.GetValue("BottomAxisTitle", s); s._axisStyles[CSLineID.Y1].Title = (TextGraphic)info.GetValue("RightAxisTitle", s); s._axisStyles[CSLineID.X1].Title = (TextGraphic)info.GetValue("TopAxisTitle", s); if (!showLeft) s._axisStyles.Remove(CSLineID.Y0); if (!showRight) s._axisStyles.Remove(CSLineID.Y1); if (!showBottom) s._axisStyles.Remove(CSLineID.X0); if (!showTop) s._axisStyles.Remove(CSLineID.X1); var legend = (TextGraphic)info.GetValue("Legend", s); // XYPlotLayer specific object linkedLayer = info.GetValue("LinkedLayer", s); if (linkedLayer is Main.AbsoluteDocumentPath) { ProvideLinkedScalesWithLinkedLayerIndex(s, (Main.AbsoluteDocumentPath)linkedLayer, info); } else if (linkedLayer is Main.RelativeDocumentPath) { ProvideLinkedScalesWithLinkedLayerIndex(s, (Main.RelativeDocumentPath)linkedLayer, info); } s.GraphObjects.AddRange((IEnumerable<IGraphicBase>)info.GetValue("GraphObjects", s)); s._plotItems = (PlotItemCollection)info.GetValue("Plots", s); if (null != s._plotItems) s._plotItems.ParentObject = s; if (null != legend) { var legend1 = new LegendText(legend); s._graphObjects.Add(legend1); } return s; }
public HRule(double value, Color color, LegendText legend, float width) : base(color, legend, width) { this.value = value; }
public VRule(long timestamp, Color color, LegendText legend, float width) : base(color, legend, width) { this.timestamp = timestamp; }
/** * Does the same as {@link #line(String, java.awt.Paint, String)}, * but the graph gets stacked on top of the * previous LINE, AREA or STACK graph. Depending on the type of the * previous graph, the STACK will be either a LINE or an AREA. This * obviously implies that the first STACK must be preceded by an AREA * or LINE. * <p/> * Note, that when you STACK onto *UNKNOWN* data, JRobin will not * draw any graphics ... *UNKNOWN* is not zero. * * @param srcName Virtual source name * @param color Stacked graph color * @param legend Legend text * @throws RrdException Thrown if this STACK has no previously defined AREA, STACK or LINE * graph bellow it. */ public void stack(String srcName, Color color, String legend) { // find parent AREA or LINE SourcedPlotElement parent = null; for (int i = plotElements.Count - 1; i >= 0; i--) { PlotElement plotElement = plotElements[i]; if (plotElement is SourcedPlotElement) { parent = (SourcedPlotElement) plotElement; break; } } if (parent == null) { throw new RrdException("You have to stack graph onto something (line or area)"); } else { LegendText legendText = new LegendText(color, legend); comments.Add(legendText); plotElements.Add(new Stack(parent, srcName, color)); } }
/** * Plots requested data in the form of the filled area starting from zero, * using the color specified. * * @param srcName * Virtual source name. * @param color * Color of the filled area. * @param legend * Legend text. */ public void area(String srcName, Color color, String legend) { area(srcName, color); if ((legend != null) && (legend.Length > 0)) { LegendText legendText = new LegendText(color, legend); comments.Add(legendText); } }
/** * Plots requested data as a line, using the color and the line width specified. * * @param srcName Virtual source name * @param color Line color * @param legend Legend text * @param width Line width (default: 1.0F) */ public void line(String srcName, Color color, String legend, float width) { LegendText legendText = new LegendText(color, legend); comments.Add(legendText); plotElements.Add(new Line(srcName, color, width)); }
/** * Draws a vertical rule into the graph and optionally adds a legend * * @param timestamp Position of the rule (seconds since epoch) * @param color Rule color * @param legend Legend text. Use null to omit the text. * @param width Rule width */ public void vrule(long timestamp, Color color, String legend, float width) { LegendText legendText = new LegendText(color, legend); comments.Add(legendText); plotElements.Add(new VRule(timestamp, color, legendText, width)); }
/** * Draws a horizontal rule into the graph and optionally adds a legend * * @param value Position of the rule * @param color Rule color * @param legend Legend text. If null, legend text will be omitted. * @param width Rule width */ public void hrule(double value, Color color, String legend, float width) { LegendText legendText = new LegendText(color, legend); comments.Add(legendText); plotElements.Add(new HRule(value, color, legendText, width)); }
/// <inheritdoc /> public bool Equals([AllowNull] Edits other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AnnotationPosition == other.AnnotationPosition || AnnotationPosition != null && AnnotationPosition.Equals(other.AnnotationPosition) ) && ( AnnotationTail == other.AnnotationTail || AnnotationTail != null && AnnotationTail.Equals(other.AnnotationTail) ) && ( AnnotationText == other.AnnotationText || AnnotationText != null && AnnotationText.Equals(other.AnnotationText) ) && ( AxisTitleText == other.AxisTitleText || AxisTitleText != null && AxisTitleText.Equals(other.AxisTitleText) ) && ( ColorbarPosition == other.ColorbarPosition || ColorbarPosition != null && ColorbarPosition.Equals(other.ColorbarPosition) ) && ( ColorbarTitleText == other.ColorbarTitleText || ColorbarTitleText != null && ColorbarTitleText.Equals(other.ColorbarTitleText) ) && ( LegendPosition == other.LegendPosition || LegendPosition != null && LegendPosition.Equals(other.LegendPosition) ) && ( LegendText == other.LegendText || LegendText != null && LegendText.Equals(other.LegendText) ) && ( ShapePosition == other.ShapePosition || ShapePosition != null && ShapePosition.Equals(other.ShapePosition) ) && ( TitleText == other.TitleText || TitleText != null && TitleText.Equals(other.TitleText) )); }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = (o == null ? new XYPlotLayer(info) : (XYPlotLayer)o); int count; // Background var bgs = (IBackgroundStyle)info.GetValue("Background", s); if (null != bgs) { if (!s.GridPlanes.Contains(CSPlaneID.Front)) { s.GridPlanes.Add(new GridPlane(CSPlaneID.Front)); } s.GridPlanes[CSPlaneID.Front].Background = bgs.Brush; } // size, position, rotation and scale var location = (XYPlotLayerPositionAndSize_V0)info.GetValue("LocationAndSize", s); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); s._coordinateSystem.UpdateAreaSize(s._cachedLayerSize); s.Location = location.ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // LayerProperties bool clipDataToFrame = info.GetBoolean("ClipDataToFrame"); s._dataClipping = clipDataToFrame ? LayerDataClipping.StrictToCS : LayerDataClipping.None; // axis related var linkedScales = (Altaxo.Graph.Scales.Deprecated.LinkedScaleCollection)info.GetValue("AxisProperties", s); s.SetupOldAxes(linkedScales); // Styles var ssc = (G2DScaleStyleCollection)info.GetValue("AxisStyles", s); var gplane = new GridPlane(CSPlaneID.Front); gplane.GridStyle[0] = ssc.ScaleStyle(0).GridStyle; gplane.GridStyle[1] = ssc.ScaleStyle(1).GridStyle; s.GridPlanes.Add(gplane); foreach (AxisStyle ax in ssc.AxisStyles) { s._axisStyles.Add(ax); } // Legends count = info.OpenArray("Legends"); var legend = (TextGraphic)info.GetValue("e", s); info.CloseArray(count); // XYPlotLayer specific count = info.OpenArray("LinkedLayers"); var linkedLayer = (Main.RelDocNodeProxy)info.GetValue("e", s); info.CloseArray(count); ProvideLinkedScalesWithLinkedLayerIndex(s, linkedLayer, info); s.GraphObjects.AddRange((IEnumerable <IGraphicBase>)info.GetValue("GraphicGlyphs", s)); if (null != legend) { var legend1 = new LegendText(legend); s.GraphObjects.Add(legend1); } s.PlotItems = (PlotItemCollection)info.GetValue("Plots", s); return(s); }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = null != o ? (XYPlotLayer)o : new XYPlotLayer(info); bool fillLayerArea = info.GetBoolean("FillLayerArea"); var layerAreaFillBrush = (BrushX)info.GetValue("LayerAreaFillBrush", s); if (fillLayerArea) { if (!s.GridPlanes.Contains(CSPlaneID.Front)) { s.GridPlanes.Add(new GridPlane(CSPlaneID.Front)); } s.GridPlanes[CSPlaneID.Front].Background = layerAreaFillBrush; } // size, position, rotation and scale var widthType = (XYPlotLayerSizeType)info.GetValue("WidthType", s); var heightType = (XYPlotLayerSizeType)info.GetValue("HeightType", s); var width = info.GetDouble("Width"); var height = info.GetDouble("Height"); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", s); s._coordinateSystem.UpdateAreaSize(s._cachedLayerSize); var xPositionType = (XYPlotLayerPositionType)info.GetValue("XPositionType", s); var yPositionType = (XYPlotLayerPositionType)info.GetValue("YPositionType", s); var xPosition = info.GetDouble("XPosition"); var yPosition = info.GetDouble("YPosition"); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s); var rotation = info.GetSingle("Rotation"); var scale = info.GetSingle("Scale"); s.Location = new XYPlotLayerPositionAndSize_V0(widthType, width, heightType, height, xPositionType, xPosition, yPositionType, yPosition, rotation, scale).ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition); // axis related var xAxis = (Altaxo.Graph.Scales.Deprecated.Scale)info.GetValue("XAxis", s); var yAxis = (Altaxo.Graph.Scales.Deprecated.Scale)info.GetValue("YAxis", s); bool xIsLinked = info.GetBoolean("LinkXAxis"); bool yIsLinked = info.GetBoolean("LinkYAxis"); double xOrgA = info.GetDouble("LinkXAxisOrgA"); double xOrgB = info.GetDouble("LinkXAxisOrgB"); double xEndA = info.GetDouble("LinkXAxisEndA"); double xEndB = info.GetDouble("LinkXAxisEndB"); double yOrgA = info.GetDouble("LinkYAxisOrgA"); double yOrgB = info.GetDouble("LinkYAxisOrgB"); double yEndA = info.GetDouble("LinkYAxisEndA"); double yEndB = info.GetDouble("LinkYAxisEndB"); s.SetupOldAxis(0, xAxis, xIsLinked, xOrgA, xOrgB, xEndA, xEndB); s.SetupOldAxis(1, yAxis, yIsLinked, yOrgA, yOrgB, yEndA, yEndB); // Styles bool showLeft = info.GetBoolean("ShowLeftAxis"); bool showBottom = info.GetBoolean("ShowBottomAxis"); bool showRight = info.GetBoolean("ShowRightAxis"); bool showTop = info.GetBoolean("ShowTopAxis"); s._axisStyles.AxisStyleEnsured(CSLineID.Y0).AxisLineStyle = (AxisLineStyle)info.GetValue("LeftAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.X0).AxisLineStyle = (AxisLineStyle)info.GetValue("BottomAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.Y1).AxisLineStyle = (AxisLineStyle)info.GetValue("RightAxisStyle", s); s._axisStyles.AxisStyleEnsured(CSLineID.X1).AxisLineStyle = (AxisLineStyle)info.GetValue("TopAxisStyle", s); s._axisStyles[CSLineID.Y0].MajorLabelStyle = (AxisLabelStyle)info.GetValue("LeftLabelStyle", s); s._axisStyles[CSLineID.X0].MajorLabelStyle = (AxisLabelStyle)info.GetValue("BottomLabelStyle", s); s._axisStyles[CSLineID.Y1].MajorLabelStyle = (AxisLabelStyle)info.GetValue("RightLabelStyle", s); s._axisStyles[CSLineID.X1].MajorLabelStyle = (AxisLabelStyle)info.GetValue("TopLabelStyle", s); // Titles and legend s._axisStyles[CSLineID.Y0].Title = (TextGraphic)info.GetValue("LeftAxisTitle", s); s._axisStyles[CSLineID.X0].Title = (TextGraphic)info.GetValue("BottomAxisTitle", s); s._axisStyles[CSLineID.Y1].Title = (TextGraphic)info.GetValue("RightAxisTitle", s); s._axisStyles[CSLineID.X1].Title = (TextGraphic)info.GetValue("TopAxisTitle", s); if (!showLeft) { s._axisStyles.Remove(CSLineID.Y0); } if (!showRight) { s._axisStyles.Remove(CSLineID.Y1); } if (!showBottom) { s._axisStyles.Remove(CSLineID.X0); } if (!showTop) { s._axisStyles.Remove(CSLineID.X1); } var legend = (TextGraphic)info.GetValue("Legend", s); // XYPlotLayer specific object linkedLayer = info.GetValue("LinkedLayer", s); if (linkedLayer is Main.AbsoluteDocumentPath) { ProvideLinkedScalesWithLinkedLayerIndex(s, (Main.AbsoluteDocumentPath)linkedLayer, info); } else if (linkedLayer is Main.RelativeDocumentPath) { ProvideLinkedScalesWithLinkedLayerIndex(s, (Main.RelativeDocumentPath)linkedLayer, info); } s.GraphObjects.AddRange((IEnumerable <IGraphicBase>)info.GetValue("GraphObjects", s)); s._plotItems = (PlotItemCollection)info.GetValue("Plots", s); if (null != s._plotItems) { s._plotItems.ParentObject = s; } if (null != legend) { var legend1 = new LegendText(legend); s._graphObjects.Add(legend1); } return(s); }