Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a TDBChart TBarSeries to TLineSeries

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I am working with a TDBChart and have a number or Series set up. I am looking for a simple means of converting an existing TBarSeries to a TLineSeries (and alternatively vice-versa). Is there a way of doing this ?
I know the properties and events will not all be equatable but some are which I would like to maintain (whether I am showing Data point Marks for instance).
The only method I can see at the moment would be to clear the existing series and re-create them as the other style - I'm hoping there's a more direct approach less prone to developer error.
Any help would be appreciated.
Thanks in advance.
Steve
 
Should anyone be interested in the resolution to this I found the appropriate code :
(This example changes the Series from a TBarSeries to TLineSeries)

procedure ChangeToLineSeries;
var
tpI : Integer;
tpSeries : TChartSeries;
begin
for tpI := 0 to (DBChart1.SeriesCount - 1) do
begin
tpSeries := DBChart1.Series[tpI];
ChangeSeriesType(tpSeries, TChartSeries(TLineSeries));
end;
end;


Not sure if anyone's tried this but it's nice to get some closure on the issue. :)
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top