LucieLastic
Programmer
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
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