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!

Add a 2nd Y axis to DBChart at runtime?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi

Can anyone tell me how to add a 2nd Y axis (on the right hand side of the graph) at runtime ? This 2nd axis will also be a different scale. This is my little method so far (xSelField, ySelfField : TField):-

NewSeries := TLineSeries.Create(self);
NewSeries.ParentChart := OvlGraph.Chart;
NewSeries.CheckDataSource;
NewSeries.DataSource := Query;
NewSeries.YValues.ValueSource := ySelField.FieldName;
if OvlGraph.Chart.SeriesCount = 2 then
begin
OvlGraph.Chart.RightAxis.LabelsOnAxis := true;
// -----SET RIGHT AXIS HERE
end;
NewSeries.XValues.ValueSource := xSelField.FieldName;

if xSelField.DataType = ftDateTime
then NewSeries.XValues.DateTime := true;
if ySelField.DataType = ftDateTime
then NewSeries.YValues.DateTime := true;

NewSeries.Title := ySelField.FieldName;
//END of SNIPPET.


Many thanks for any help
lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top