FarPoint.Win.Spread.ExcelSparklineSetting eSetting = new FarPoint.Win.Spread.ExcelSparklineSetting();
eSetting.ShowMarkers = true;
eSetting.AxisColor = Color.Cyan;
eSetting.DateAxis = true;
eSetting.DisplayEmptyCellsAs = FarPoint.Win.Spread.Chart.EmptyValueStyle.Gaps;
eSetting.DisplayHidden = true;
eSetting.DisplayXAxis = true;
eSetting.FirstMarkerColor = Color.AliceBlue;
eSetting.Formula = "Sheet1!$A$4:$E$4";
eSetting.HighMarkerColor = Color.Honeydew;
eSetting.LastMarkerColor = Color.Lavender;
eSetting.LineWeight = 2;
eSetting.LowMarkerColor = Color.LawnGreen;
eSetting.ManualMax = 3;
eSetting.ManualMin = 1;
eSetting.MarkersColor = Color.Magenta;
eSetting.MaxAxisType = FarPoint.Win.Spread.SparklineAxisMinMax.Custom;
eSetting.MinAxisType = FarPoint.Win.Spread.SparklineAxisMinMax.Individual;
eSetting.NegativeColor = Color.NavajoWhite;
eSetting.RightToLeft = true;
eSetting.SeriesColor = Color.SeaGreen;
eSetting.ShowFirst = true;
eSetting.ShowHigh = true;
eSetting.ShowLast = true;
eSetting.ShowLow = true;
eSetting.ShowNegative = true;
FarPoint.Win.Spread.ExcelSparklineSetting ess = eSetting;
string fileName = "c:\\ExcelSparklineSetting.xml";
//Serialize
System.IO.Stream stream;
stream = System.IO.File.Open(fileName, System.IO.FileMode.Create);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(stream, System.Text.Encoding.UTF8);
writer.Formatting = System.Xml.Formatting.Indented; writer.Indentation = 2;
writer.WriteStartDocument();
writer.WriteStartElement("ExcelSparklineSetting");
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
//Deserialize
FarPoint.Win.Spread.ExcelSparklineSetting ess1 = new FarPoint.Win.Spread.ExcelSparklineSetting();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(fileName);
System.Xml.XmlNode node;
node = doc.FirstChild;
while (!node.Name.Equals("ExcelSparklineSetting"))
node = node.NextSibling;
System.Xml.XmlNodeReader r = new System.Xml.XmlNodeReader(node);
r.Read();