Attached are two charts. When the user clicks on a month in the BarChart (January in this case), it displays that months expense categories below in a PieChart. Is there any way to color or keep the clicked bar highlighted (like when hovering over it)? This way the user always see which month is being displayed in the PieChart below.
Thanks.
Show Selected using 2 charts
Show Selected using 2 charts
- Attachments
-
- 2017-08-13_2233.png (68.7 KiB) Viewed 16934 times
Re: Show Selected using 2 charts
Hello realsol,
I think you can active the Hover propierty. The code below shows you how?
Hoping this helps you.
Thanks in advance
I think you can active the Hover propierty. The code below shows you how?
Code: Select all
Chart1.Hover.Visible := Hover;
Thanks in advance
Best Regards,
Sandra Pazos / 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 |
Re: Show Selected using 2 charts
This gave me an error on 'Hover', so I tried this in the OnSeriesClick Event:Sandra wrote:Hello realsol,
I think you can active the Hover propierty. The code below shows you how?Hoping this helps you.Code: Select all
Chart1.Hover.Visible := Hover;
Thanks in advance
Code: Select all
Chart1.Hover.Visible := true;
Re: Show Selected using 2 charts
Hello realsol,
I have made a simple code with help of MouseDown and MouseUp events, I can select a concrete bar value when I do click in it. The code I have used is below:
Could you confirm us if it works in your end?
Thanks in advance
I have made a simple code with help of MouseDown and MouseUp events, I can select a concrete bar value when I do click in it. The code I have used is below:
Code: Select all
procedure TForm2.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if avalueIndex<>-1 then
Chart1[0].ValueColor[avalueIndex] :=aColor;
end;
procedure TForm2.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var valueIndex:Integer;
begin
valueIndex:=Chart1[0].Clicked(X, Y);
if valueIndex>-1 then
begin
Chart1[0].ValueColor[valueIndex] := clRed;
avalueIndex := valueIndex;
end;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.AddSeries(TBarSeries).FillSampleValues();
aColor := Chart1[0].Color;
avalueIndex:=-1;
end;
Thanks in advance
Best Regards,
Sandra Pazos / 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 |