Hello all,
I am completely stack with this so I need a fresh look from someone else!!! I created this chart, works as I want to but it looks like I cannot hide one name group, for example I need the user to be able to show/hide Name1 or Name2 etc. Any help please !!!!
Need some help for a simple task!!!
Need some help for a simple task!!!
- Attachments
-
- Untitled-1.gif (5.53 KiB) Viewed 8312 times
Re: Need some help for a simple task!!!
Hi Johnnix,
Could you please clarify if you want to hide just the "Name2" text, or also the bars above it?
Could you please clarify if you want to hide just the "Name2" text, or also the bars above it?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Need some help for a simple task!!!
Hello,
I need to hide both label and bars
Regards
I need to hide both label and bars
Regards
Re: Need some help for a simple task!!!
Hi Johnnix,
Then, I'd work with null points. Known the ValueIndex to hide, you can loop all your series and set as null:
Then, I'd work with null points. Known the ValueIndex to hide, you can loop all your series and set as null:
Code: Select all
for i:=0 to Chart1.SeriesCount-1 do
Chart1[i].SetNull(ValueIndex);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Need some help for a simple task!!!
Hi again,
In addition to the above, when I tried the following code, where I have 5 TBarSeries with 5 values each and I want to hide the ValueIndex=2:
I've seen the bars with ValueIndex=2 are correctly hidden, but not the bottom axis label.
However, you can always hide those labels in the bottom axis with no visible value associated:
And the above seems to work fine for me here.
In addition to the above, when I tried the following code, where I have 5 TBarSeries with 5 values each and I want to hide the ValueIndex=2:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i, j, ValueIndex: Integer;
begin
Chart1.View3D:=false;
for i:=0 to 4 do
begin
with Chart1.AddSeries(TBarSeries) do
begin
FillSampleValues(5);
Marks.Visible:=false;
for j:=0 to Chart1[i].Count-1 do
Chart1[i].Labels.Labels[j]:='Name'+IntToStr(j+1);
end;
end;
ValueIndex:=2; //ValueIndex to hide
for i:=0 to Chart1.SeriesCount-1 do
Chart1[i].SetNull(ValueIndex);
end;
However, you can always hide those labels in the bottom axis with no visible value associated:
Code: Select all
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
var i: Integer;
begin
if (Sender=Chart1.Axes.Bottom) and (ValueIndex>-1) then
for i:=0 to Chart1.SeriesCount-1 do
if Chart1[i].IsNull(ValueIndex) then
begin
if i=Chart1.SeriesCount-1 then
LabelText:='';
end
else
exit;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Need some help for a simple task!!!
Hello Yeray,
Thank you very much for the prompt reply, I will give it a try !!!
Kindest regards
Thank you very much for the prompt reply, I will give it a try !!!
Kindest regards