Hiding series in Chart Editor
Posted: Thu Aug 30, 2012 1:16 am
To better control symbol placement for dense data sets, I create a LineSeries, a FastLineSeries and a PointSeries for each set of data. The LineSeries is used only for the legend, while the other two series show the line and the points respectively. I have a lot of custom code to format the resulting graph, but also make ChartEditor available so advanced users can "tweak" the graph to their own preference.
When I open ChartEditor, all 3 series are displayed. I have attempted to hide the FastLine and Point series with the following code:
procedure TformMain.acChartEditorExecute(Sender: TObject);
begin
PBQuickGraphMain.HideFastPointSeriesInEditor;
ChartEditor.Execute;
end;
procedure TPBQuickGraph.HideFastPointSeriesInEditor;
var
i: integer;
begin
for i:=0 to Dependent1Collection.SeriesList.Count-1 do
begin
TUnitFastLineSeries(Dependent1Collection.SeriesList.Objects).ShowInEditor := false;
TUnitPointSeries(Dependent1Collection.SeriesList.Objects).ShowInEditor := false;
end;
for i:=0 to Dependent2Collection.SeriesList.Count-1 do
begin
TUnitFastLineSeries(Dependent2Collection.SeriesList.Objects).ShowInEditor := false;
TUnitPointSeries(Dependent2Collection.SeriesList.Objects).ShowInEditor := false;
end;
end;
The code is unit-aware (e.g. with conversions between m and feet, etc). Dependent1Collection and Dependent2Collection are related to two dependent axes, each plotting data of a separate unit type.
This code has no effect on ChartEditor as seen in attachment. Any ideas what ShowInEditor fails would be appreciated.
When I open ChartEditor, all 3 series are displayed. I have attempted to hide the FastLine and Point series with the following code:
procedure TformMain.acChartEditorExecute(Sender: TObject);
begin
PBQuickGraphMain.HideFastPointSeriesInEditor;
ChartEditor.Execute;
end;
procedure TPBQuickGraph.HideFastPointSeriesInEditor;
var
i: integer;
begin
for i:=0 to Dependent1Collection.SeriesList.Count-1 do
begin
TUnitFastLineSeries(Dependent1Collection.SeriesList.Objects).ShowInEditor := false;
TUnitPointSeries(Dependent1Collection.SeriesList.Objects).ShowInEditor := false;
end;
for i:=0 to Dependent2Collection.SeriesList.Count-1 do
begin
TUnitFastLineSeries(Dependent2Collection.SeriesList.Objects).ShowInEditor := false;
TUnitPointSeries(Dependent2Collection.SeriesList.Objects).ShowInEditor := false;
end;
end;
The code is unit-aware (e.g. with conversions between m and feet, etc). Dependent1Collection and Dependent2Collection are related to two dependent axes, each plotting data of a separate unit type.
This code has no effect on ChartEditor as seen in attachment. Any ideas what ShowInEditor fails would be appreciated.