I'm assigning a chart to another temporary invisible chart for printing from. I've changed the main chart's mark's text in OnGetMarkText. The original, not the changed text, is what is printed from the second chart.
Is there a way to access the actual mark's text and assign that to the new chart ? Perhaps expose the second chart's series OnGetMarkText event and change it there or access the second chart's mark's DrawText method ? Or create the second chart then change its mark text from the main chart's series OnGetMarkText event ?
Steve
Mark Text not persisted when assign to another chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
You have to do it "manually". One easy way to do this is assigning the cloned series OnGetMarkText event to the original series event like shown below.
You have to do it "manually". One easy way to do this is assigning the cloned series OnGetMarkText event to the original series event like shown below.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
Series1.FillSampleValues();
InvChart.FreeAllSeries;
InvChart.Assign(Chart1);
for i:=0 to Chart1.SeriesCount-1 do
begin
CloneChartSeries(Chart1[i]).ParentChart:=InvChart;
InvChart[i].OnGetMarkText:=Chart1[i].OnGetMarkText;
end;
end;
procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
MarkText:='Mark '+IntToStr(ValueIndex);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |