I have a little problem in scaling a chart to the right extend.
I want to display different figures with ShapeSeries on my chart, which has a bigger width then height (1.67 times more or less).
The idea now was to use the max / min members of Bottom / Left axis to scale the chart (I want a circle displayed as a circle and a square not like a long table).
Therefor I used the following code, which does not really help me - I think it is because of the margins and maybe others setup values of TChart.
Which Width/Height Values could I use for scaling ?
minx,miny... are the real min / max values in the chart which should be displayed.
the outcommented lower part is for having a little ring of free space around the shapes.
Code: Select all
{ Es soll so skaliert werden, dass das Verhältnis auf X und Y Achse gleich
bleibt, und im Raster quadratische Muster entstehen }
chart.LeftAxis.Minimum := miny;
chart.BottomAxis.Minimum := minx;
chart.LeftAxis.Maximum := maxy;
chart.BottomAxis.Maximum :=
(chart.ChartWidth / chart.chartHeight) * maxx;
//scale := max((maxx -minx), (maxy-miny));
//chart.LeftAxis.Minimum := chart.LeftAxis.Minimum - (scale * 0.1);
//chart.BottomAxis.Minimum := chart.BottomAxis.Minimum - (scale * 0.1);
//chart.LeftAxis.Maximum := chart.LeftAxis.Maximum + (scale * 0.1);
//chart.BottomAxis.Maximum := chart.BottomAxis.Maximum + (scale * 0.1);