Is it possible to have a different YOrigin for each data value of a Horizontal Bar series ? If not, could this feature be added to the Wish List ?
Thanks,
Steve
Horizontal Bar series - a YOrigin for each data value
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
I'm afraid this is not possible but you can easily do that creating one bar series for each value so that you can set each value YOrigin as done here:
I'll also add your request to our wish-list to be considered for future releases.
I'm afraid this is not possible but you can easily do that creating one bar series for each value so that you can set each value YOrigin as done here:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
for i:=0 to 10 do
begin
Chart1.AddSeries(TBarSeries.Create(self));
With (Chart1[i] as TBarSeries) do
begin
AddBar(i,'',clRed);
UseYOrigin:=true;
YOrigin:=-i;
MultiBar:=mbSideAll;
if (i > 0) then ShowInLegend:=False;
end;
end;
end;
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
Then you could try with Bar3D series which allow you adding an offset to each value. With that and YValue you'll be able to determine each bar origin and height.
You could also consider using High-Low series or custom drawing rectangles on TChart's canvas.
Then you could try with Bar3D series which allow you adding an offset to each value. With that and YValue you'll be able to determine each bar origin and height.
You could also consider using High-Low series or custom drawing rectangles on TChart's canvas.
Best Regards,
Narcís Calvet / 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 |
I need a rectangle that I can set the vertical axis data value. The rectangle automatically then expands itself symetrically above and below that value half-way to the next and previous data value, analogous to Join Bars. Horizontal bar with BarWidthPercent = 100 accomplished this. As I actually only need two different YOrigin values within each series, perhaps I'll just try using two HorizBar series instead.
High-Low appears to not be for horizontal bars but instead fills its pattern to the next larger data value, instead of filling symetrically around its datavalue. I did not see the pattern for Low doing anything in the chart design editor ?
High-Low appears to not be for horizontal bars but instead fills its pattern to the next larger data value, instead of filling symetrically around its datavalue. I did not see the pattern for Low doing anything in the chart design editor ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
If I understand correctly what you are trying to achieve, why don't you do something like the snippet below with a TBar3DSeries?I need a rectangle that I can set the vertical axis data value. The rectangle automatically then expands itself symetrically above and below that value half-way to the next and previous data value, analogous to Join Bars. Horizontal bar with BarWidthPercent = 100 accomplished this. As I actually only need two different YOrigin values within each series, perhaps I'll just try using two HorizBar series instead.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var Index: Integer;
begin
Chart1.AddSeries(TBar3DSeries.Create(self));
Index:=0;
AddBar(1,0,6,Index);
AddBar(2,5,4,Index);
AddBar(3,2,2,Index);
AddBar(4,6,2,Index);
AddBar(5,8,10,Index);
Chart1[Index].Marks.Visible:=false;
end;
procedure TForm1.AddBar(X,YOrigin,YValue: Double; SeriesIndex: Integer);
begin
(Chart1[SeriesIndex] as TBar3DSeries).AddBar(X,YOrigin-(YValue/2),YOrigin+(YValue/2));
end;
Besides setting Low values when using AddHighLow method you can only set its format at Series\Format\Low button .High-Low appears to not be for horizontal bars but instead fills its pattern to the next larger data value, instead of filling symetrically around its datavalue. I did not see the pattern for Low doing anything in the chart design editor ?
Best Regards,
Narcís Calvet / 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 |