Stacked bar charts not auto-scaled
Stacked bar charts not auto-scaled
I use stacked bar charts to represent well lithology. Rather than starting at zero, the vertical origin of the charts are offset by an amount corresponding to the elevation of the wellhead. However, when I plot the charts they do not auto-scale but run off the top of the chart, as shown. Any idea why this might be happening? The elevations of the wells are 282, 282, 292, 292 and 206 m respectively.
- Attachments
-
- MultipleBarChart.png (67.23 KiB) Viewed 5623 times
Re: Stacked bar charts not auto-scaled
Hello,
You can set a different Origin for each TBarSeries but I understand you need to set an offset for each value.
Then, you'll need to use TBar3DSeries instead of TBarSeries. Just note that with them you'll have to play with the offsets to manually synchronize the offset of each value matching predecessor series values+offset. Ie:
You can set a different Origin for each TBarSeries but I understand you need to set an offset for each value.
Then, you'll need to use TBar3DSeries instead of TBarSeries. Just note that with them you'll have to play with the offsets to manually synchronize the offset of each value matching predecessor series values+offset. Ie:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i, j, n: Integer;
tmp: Double;
begin
Chart1.View3D:=false;
for i:=0 to 8 do
with Chart1.AddSeries(TBar3DSeries) as TBar3DSeries do
begin
for j:=0 to 4 do
begin
if (i=0) then
tmp:=200+random*100
else
tmp:=(Chart1[0] as TBar3DSeries).OffsetValues[j];
for n:=0 to Chart1.SeriesCount-2 do
tmp:=tmp+Chart1[n].YValue[j];
AddBar(j, 25+random*75, tmp);
end;
MultiBar:=mbStacked;
Marks.Visible:=false;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Stacked bar charts not auto-scaled
Hello Yeray. Thanks for your reply but I think we may be talking at cross-purposes here, probably because I did not explain well enough. We have developed a UnitBarSeries unit with which I am able to offset the bar charts correctly simply by setting a YPosition variable for each chart, which corresponds to the elevation of each well. See attachment with the charts dragged down to show the tops of each bar chart. However, when I unzoom, the charts go off the top of the graph, by a small amount as shown in the previous post. How can I control automatic scaling to show the whole graph?
- Attachments
-
- PannedBarChart.png (67.57 KiB) Viewed 5501 times
Re: Stacked bar charts not auto-scaled
Hello,
That's how the TErrorBarSeries adds extra margin on the vertical axis to fit the error line.
Try overriding these functions on your UnitBarSeries:Errol wrote:Thanks for your reply but I think we may be talking at cross-purposes here, probably because I did not explain well enough. We have developed a UnitBarSeries unit with which I am able to offset the bar charts correctly simply by setting a YPosition variable for each chart, which corresponds to the elevation of each well. See attachment with the charts dragged down to show the tops of each bar chart. However, when I unzoom, the charts go off the top of the graph, by a small amount as shown in the previous post. How can I control automatic scaling to show the whole graph?
Code: Select all
Function MinYValue:Double; override;
Function MaxYValue:Double; override;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |