Labeling Points in the Chart with Marks
Posted: Fri Jun 27, 2008 7:35 am
Hello everyone,
I've got a little problem with labelling point in a chart.
The goal is to label each point with variable text, if the user likes or to hide the labels if the user dislikes them.
So far everything works using:
===========
The marks don't look like in design time. I designed little grey boxes with bold font in a designed size.
Each time I compile and run the program, the marks show up as if they where Tooltips - light yellow background and tooltip font.
The second thing is, I want the marks to be displayed above to the right from each point. For some reason they are always centered above the point.
Any idea how to fix this ??
this is the code I currently use to display the variable text for the marks:
I've got a little problem with labelling point in a chart.
The goal is to label each point with variable text, if the user likes or to hide the labels if the user dislikes them.
So far everything works using:
But:series.Marks.Visible = true/false
===========
The marks don't look like in design time. I designed little grey boxes with bold font in a designed size.
Each time I compile and run the program, the marks show up as if they where Tooltips - light yellow background and tooltip font.
The second thing is, I want the marks to be displayed above to the right from each point. For some reason they are always centered above the point.
Any idea how to fix this ??
this is the code I currently use to display the variable text for the marks:
Code: Select all
{ Punkte Namen aktualisieren }
seriesP.Marks.Color := clSilver;
seriesP.Marks.Font.Name := 'Tahoma';
seriesP.Marks.Font.Color := clBlack;
seriesP.Marks.Font.Size := 7;
seriesP.Marks.Font.Style := [fsBold];
seriesP.Marks.BackColor := clSilver;
seriesP.Marks.Transparency := 0;
for Index := 0 to PointStack.Count -1 do
with seriesP.Marks.Item[ Index ].Text do begin
seriesP.Marks.Item[ Index ].Text.Clear();
seriesP.Marks.Item[ Index ].ShapeBounds.Left := seriesP.Marks.Item[ Index ].ShapeBounds.Left + 20;
Font.Style := [fsBold];
Font.Name := 'Tahoma';
Font.Size := 7;
Color := clGray;
if PointStack.Items[Index].ZValid then
Add( FloatToStr(PointStack.NormItems[Index].Z / 1000) )
else
Add('N/V');
end;