Hi,
Is it at all possible, to toggle the chart between Horizontal Bar, and Bar, with the same data, but differently orientated, according to user preference.
If possible, how do I achieve this in code?
I want to rotate this from HorizontalBar to Bar.
Switch programatically between HorizontalBar, and Bar
Switch programatically between HorizontalBar, and Bar
- Attachments
-
- horbarfixed.jpg (57.76 KiB) Viewed 5564 times
Re: Switch programatically between HorizontalBar, and Bar
Hi Doogie,
Yes, you could use ChangeSeriesType function. For example:
Yes, you could use ChangeSeriesType function. For example:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
tmp: TChartSeries;
begin
for i:=0 to Chart1.SeriesCount-1 do
begin
tmp:=Chart1[i];
if Chart1[i] is THorizBarSeries then ChangeSeriesType(tmp,TBarSeries)
else ChangeSeriesType(tmp,THorizBarSeries);
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |