Hi
Is it possible to add multiple lines to a ChartGrid top line. I want to add more information about the series on say 3 lines of data.
If I use #13#10 (or #13) in the title string for the Series.Title it doesn't place multiple lines on the grid, but shows on continuous one line.
I have set the row height to be suitable to accommodate multiple lines.
How can I change the ChartGrid top line for each series and add multiple lines of text for each series added?
Many thanks
Trevor
ChartGrid multiline heading?
Re: ChartGrid multiline heading?
This is what I would like over 3 lines instead of one
- Attachments
-
- 22-07-2010 5-22-25 PM.png (3.45 KiB) Viewed 4528 times
Re: ChartGrid multiline heading?
Hi Trevor,
I cound reproduce it.
I've seen that a workaround for the TCustomDrawGrid is to use OnDrawCell event as in the example bellow. But this event is defined in TCustomDrawGrid and this class inherits from TCustomGrid, and TChartGrid inherits from TCustomGrid too, so this event isn't defined.
I've added it to the wish list to be enhanced in future releases (TV52015047).
I cound reproduce it.
I've seen that a workaround for the TCustomDrawGrid is to use OnDrawCell event as in the example bellow. But this event is defined in TCustomDrawGrid and this class inherits from TCustomGrid, and TChartGrid inherits from TCustomGrid too, so this event isn't defined.
I've added it to the wish list to be enhanced in future releases (TV52015047).
Code: Select all
procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Longint; Rect: TRect; State: TGridDrawState);
var
Line1: string;
Line2: string;
ptr: integer;
padding: integer;
hGrid: TStringGrid;
begin
hGrid:= (Sender as TStringGrid);
ptr := Pos(';', hGrid.Cells[Col, Row]);
if ptr > 0 then
begin
Line1 := Copy(hGrid.Cells[Col, Row], 1, ptr - 1);
Line2 := Copy(hGrid.Cells[Col, Row], ptr + 1, Length(hGrid1.Cells[Col,Row]) - ptr);
end
else Line1 := hGrid.Cells[Col, Row];
hGrid.Canvas.FillRect(Rect);
hGrid.Canvas.TextOut(Rect.Left, Rect.Top + 2, Line1);
if ptr > 0 then
hGrid.Canvas.TextOut(Rect.Left, Rect.Top - hGrid.Canvas.Font.Height + 3, Line2);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |