Hi
I have a 5 by 5 grid of subcharts.
I would like to have it zoom one of the charts to full size if the mouse is held down over it - I have achieved this - but the charts do not have any way of re-ordering them, so if I Click on the first chat I made, most of it is hidden behind the other charts. If I click on the last one it woks fine - can I reorder the charts so that this will work - I want to avoid destroying all the charts if I can as I was hoping to get a nice zoom in feel with the clicked on chart getting bigger with the other small charts behind them!
Thanks for any help
Richard
Sub chart order
Re: Sub chart order
Hi Richard,
Here is how you could swap two charts in a same TSubChartTool:
Then you can use the Chart OnMouseDown event to check what SubChart has been clicked, and then you could swap the chart directly with the chart with index 0, or swap it with all the charts up to the index 0.
Here you have a starting point:
Here is how you could swap two charts in a same TSubChartTool:
Code: Select all
procedure TForm1.SwapChart(Index1, Index2: Integer);
var tmp : TSubChart;
begin
tmp:=ChartTool1.Charts[Index2];
ChartTool1.Charts[Index1].Index:=Index2;
tmp.Index:=Index1;
Chart1.Draw;
end;
Here you have a starting point:
Code: Select all
procedure TForm1.Chart1Click(Sender: TObject);
begin
if ChartTool1.Charts[0].Clicked(myMouseDown.X, myMouseDown.Y) then
SwapChart(0,1);
end;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
myMouseDown.X:=X;
myMouseDown.Y:=Y;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Sub chart order
Thanks for the heads up - it was the index value I was missing