Saving and restoring Color Lines

TeeChart for ActiveX, COM and ASP
Post Reply
Reza
Newbie
Newbie
Posts: 3
Joined: Fri Feb 20, 2004 5:00 am

Saving and restoring Color Lines

Post by Reza » Mon Aug 16, 2004 10:05 am

Hello,

I have created an application where by whenever it loads up, it recreates my chart and provides functionality to add or delete Color Lines.

I would like to know how I can save the position of the lines that I have drawn such that when my application loads up the next time round, I can re-add the lines in exactly the same position and length.

I was thinking of using the technique below to store the line information

Code: Select all

ProfileWrite SettingsFileName, "ColorLine1", "Color", ColorValue
ProfileWrite SettingsFileName, "ColorLine1", "Position", PositionValue
Would the PositionValue be the following Color Line property that I need to store?

Code: Select all

TChart1.Tools.Items(0).asColorLine.Value

Is this the correct way of implementing this or is there an easier way of doing it?

Many Thanks,
Reza.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Aug 16, 2004 12:40 pm

Hi --
Is this the correct way of implementing this or is there an easier way of doing it?
You could using TeeChart's native templates (*.tee) files to store the information for you, e.g.

Code: Select all

Private Sub Command1_Click()
Dim Stream
Stream = TChart1.Export.asNative.SaveToStream(True)
TChart2.Import.LoadFromStream Stream
End Sub

Private Sub Form_Load()
With TChart1
    .AddSeries scLine
    .Series(0).FillSampleValues 20
   
    .Tools.Add tcColorLine
    .Tools.Items(0).asColorLine.Axis = .Axis.Bottom
    .Tools.Items(0).asColorLine.Value = 10
    .Tools.Items(0).asColorLine.Pen.Color = vbCyan
End With
End Sub
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply