Temlates
Posted: Mon Jan 05, 2009 11:07 pm
I have created a chart with horizontal bar series. Made series marks not visible and exported it to the template file. Later I load this template and the series marks are visible. Why?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.FillSampleValues();
bar1.Marks.Visible = false;
System.IO.MemoryStream stream = new System.IO.MemoryStream();
tChart1.Export.Template.Save(stream);
tChart1.Clear();
stream.Position = 0;
tChart1.Import.Template.Load(stream);
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
Steema.TeeChart.Styles.Series s = line1;
Steema.TeeChart.Styles.Series.ChangeType(ref s, typeof(Steema.TeeChart.Styles.HorizBar));
System.IO.MemoryStream stream = new System.IO.MemoryStream();
tChart1.Export.Template.Save(stream);
stream.Position = 0;
tChart1.Import.Template.Load(stream);
//foreach (Steema.TeeChart.Styles.Series b in tChart1.Series)
//{
// b.Marks.Visible = false;
//}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
Steema.TeeChart.Styles.Series s = line1;
Steema.TeeChart.Styles.Series.ChangeType(ref s, typeof(Steema.TeeChart.Styles.HorizBar));
Boolean[] visibleMarks = new Boolean[tChart1.Series.Count];
for (int i = 0; i < visibleMarks.Length; i++)
{
visibleMarks[i] = tChart1[i].Marks.Visible;
}
System.IO.MemoryStream stream = new System.IO.MemoryStream();
tChart1.Export.Template.Save(stream);
stream.Position = 0;
tChart1.Import.Template.Load(stream);
for (int i = 0; i < visibleMarks.Length; i++)
{
tChart1[i].Marks.Visible = visibleMarks[i];
}
}