Misunderstood the template technology ?
Posted: Sat Dec 22, 2007 11:11 pm
Hi Support,
today I played around a while with the template function and I wont get it working as I expect.
Let me explain what I think the templates should work
A template contains only the appearance of a chart. In other words it contains everthings except the data information.
My problem is the following ...
I have a chart with two series. Each of the series contains data (lets say 100 points in each series). I save a template of this chart with this code:
So I get something like this in the TEE file:
Now I change some properties of the chart. Lets say I change the color of the both series.
Now I want to load back the templates I saved seconds before.
The expected result should be the view as I started. But what I get i a complete empty chart. Only the appearance of my template is loaded. The data is gone.
So how can I load a template without loosing my data which is shown in the series? As I said before ... The template should only change the appearance and shouldn´t touch the data. Or am I wrong?
I can send you a small demo application if you need one.
today I played around a while with the template function and I wont get it working as I expect.
Let me explain what I think the templates should work
A template contains only the appearance of a chart. In other words it contains everthings except the data information.
My problem is the following ...
I have a chart with two series. Each of the series contains data (lets say 100 points in each series). I save a template of this chart with this code:
Code: Select all
SaveChartToFile(Chart1, dir + 'Template.lvt', False, True);
Code: Select all
object TChart
Left = 1
Top = 1
Width = 681
Height = 495
Title.Text.Strings = (
'TChart')
CustomAxes = <
item
Horizontal = False
OtherSide = False
end
item
Horizontal = False
OtherSide = False
end>
Align = alClient
TabOrder = 0
object Series1: TFastLineSeries
Marks.Arrow.Visible = True
Marks.Callout.Brush.Color = clBlack
Marks.Callout.Arrow.Visible = True
Marks.Visible = False
VertAxis = aCustomVertAxis
LinePen.Color = clRed
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Y'
YValues.Order = loNone
CustomVertAxis = 0
end
object Series2: TFastLineSeries
Marks.Arrow.Visible = True
Marks.Callout.Brush.Color = clBlack
Marks.Callout.Arrow.Visible = True
Marks.Visible = False
VertAxis = aCustomVertAxis
LinePen.Color = clGreen
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Y'
YValues.Order = loNone
CustomVertAxis = 1
end
end
Now I want to load back the templates I saved seconds before.
Code: Select all
LoadChartfromFile(TCustomChart(Chart1), OpenDialog1.FileName);
So how can I load a template without loosing my data which is shown in the series? As I said before ... The template should only change the appearance and shouldn´t touch the data. Or am I wrong?
I can send you a small demo application if you need one.