SaveDecoration(Xml: IXmlDomElement);
SaveDecoration(Xml: Prognoz.Platform.Interop.MsXml2.IXmlDomElemnt);
Xml. XML document element.
The SaveDecoration method saves custom style to an XML document.
The following chart settings are saved to XML documents:
Tag of XML document | Property |
Type | Type of the style (notional number, numbers 0, 1, 2 are reserved with system styles, the user cannot use them) |
Name | String name of the style (arbitrary) |
CommonChartProperties | General chart settings |
ChartAreaDecoration | Chart area formatting |
GraphAreaDecoration | Chart plot area formatting |
LegendDecoration | Legend formatting |
ChartCaptionDecoration | Chart caption formatting |
AxisXCaptionDecoration AxisYCaptionDecoration AxisYAdditionalCaptionDecoration |
Chart axis caption formatting (X, Y, YSec respectively) |
AxisXUnitCaptionDecoration AxisYUnitCaptionDecoration AxisYAdditionalUnitCaptionDecoration |
Formatting of caption of measurement units of a chart axis (X, Y, YSec respectively) |
AxisXDecoration AxisYDecoration AxisYAdditionalDecoration |
Axis formatting (X, Y, YSec respectively) |
DefaultSerieDecoration | Default formatting applied to new chart series (newly created series) |
AxisLinePen | Pen for drawing axis line and axis scale marks |
AxisGridPen | Pen for drawing a grid |
NoDataFontColor | Color of text of the series name in the legend (if all series values are empty) |
FontColor | Color of text of the series name in the legend |
Background | Element background fill |
Shadow | Element shadow |
Direction | Element shadow direction |
Tags of chart properties | |
Smoothing | Chart smoothing |
RoundJoint | Rounding of corners of bars of histogram |
GridVisible | Visibility of grid of chart plot area |
Tags of properties of chart background object | |
BackgroundType | Background type (0 – no background, 1 – solid fill, 2 – gradient, 3 – image, hatching, 4 – glamour fill) |
MainColor | Basic color of object background |
FirstColor | Start color of gradient |
LastColor | End color of gradient |
GradientAngle | Angle of gradient direction |
Tags of drawing properties | |
Color | Color (ARGB format, range of values [0 - 255]) |
Pen | Pen |
Width | Pen width |
Alignment | Pen line alignment |
EndCap, StartCap | Shapes at the start and at the end of the line |
SolidPen | Pen color |
Font | Font |
FontFamilyName | Font family |
FontSize | Font size |
FontSizeUnit | Font measurement units |
FontStyle | Font style |
Brush | Brush |
BrushType | Brush type (0 – solid, 1 – hatching, 2 – texture, 3 – gradient brush with a complex shape, 4 – linear gradient) |
SolidBrushColor | Color of one-colored brush |
StartColor | Start color of gradient brush |
EndColor | End color of gradient brush |
NotImplemented | Style preserving is not supported for texture brush (filling element background with an image) and brush of the GDI+ PathGradient type |
Tags of properties of formatting for new series | |
SeriePaletteCount | Number of unique basic colors (it is recommended to use default value (8)) |
ColorHuge* | Hue, color hue in the HSV model (there is a mistype in the tag, but unfortunately it cannot be corrected, * - color index [0; SeriePaletteCount-1]) |
ColorSaturation* | Color saturation in the HSV model (* - color index [0; SeriePaletteCount-1]) |
StartBrightColorValue StartDarkColorValue |
Color value in the HSV model that is used to specify two colors of series background. |
BarSerieBackgroundType | Background type (see above) used by default for a new bar series. |
SerieBackgroundType | Background type (see above) used by default for a new series of all types except bar type. |
SerieBorderWidth | Pen width for a frame around a new series |
SerieLineWidth | Pen width for drawing a new series (linear series) |
SerieNoDataLineWidth | Pen width for drawing a new series (linear series), sections without data |
SerieNoDataLineDash | Pen hatching of a new linear series. sections without data |
NOTE. When saving a style other parameters are saved for a pen or a brush, corresponding to parameters of GDI+ objects. Please refer to MSDN for details.
This example assumes that there is the Chart object of the IChart type.
Sub UserProc;
Var
Chart: IChart;
doc: IXmlDomDocument;
element: IXmlDomElement;
str: string = "<?xml version=""1.0"" encoding=""utf-8""?>" + #13 + #10 + "<test/>";
Begin
doc := New DOMDocument40.Create;
doc.loadXML(str);
element := doc.documentElement;
Chart.SaveDecoration(element);
doc.save("c:\Temp\test.xml");
End Sub UserProc;
After executing the example custom style of the chart is serialized.
See also:
IChart | Example of changing color style for all chart series