Yeray wrote: ↑Mon Jan 27, 2025 8:41 am
Hello,
MXHW wrote: ↑Fri Jan 24, 2025 3:04 pm
The main concept is that the area in which the signals (aka series) are displayed only takes up the space left by the dynamic number of axes. So, if a file has four channels, each signal in the chart has one axis. The four axes are either to the left side or the right side (or mixed eg. 2 left, 2 right) of the painting area.
The "signal area" takes the rest: Its rectangle's left and right side is the height of the custom axes (Y), the rectangle's top/bottom is the width of the time scale (X, 'bottom axis').
So, inherently, the first data point of a signal (series) is always painted some pixels (borders, padding, margins etc) to the right of the right most axis (if all axes are left), because the Minimum of 'my' X axis starts on the left side of the rectangle of the "signal area".
So are the horizontal lines of a grid.
In the example
above, all the series and grids are draw at the right of the right most axis. So as I understand, it fits that description.
However, you replied that wasn't the desired behaviour. I'm getting confused.
I'd suggest to just take "paint" and manually draw how you want it to look like and we'll prepare a simple example.
Two pictures:
One axis:
https://www.directupload.eu/file/d/8826 ... oz_jpg.htm
Two Axes:
https://www.directupload.eu/file/d/8826 ... 6r_jpg.htm
Rectangles:
A) One rectangle with the curves/signals --> "signal area"
B) One rectangle with axes/scales, width of single axis rectangle identical to others --> "axes rectangle"
C) One rectangle with bottom axis/scale
D) One big rectangle that encloses the entire picture
E) 'Rest' rectangle in the bottom-left corner
Width of one rectangle (B): Font size (height! 90° rotation), length of major tick, some margins ( |<Margin>Title/Fontheight <Margin>Major Tick| )
Width of one axis' rectangle multiplied with number of axes = width of 'axis rectangle'
Height of bottom axis (C): Font size (height), length of major tick, margins analog to the ones of the vertical axes
Left of rectangle "signal area" and "bottom axis" = D.left + B.width
Bottom of rectangle "signal area" and "axes rectangle" = D.bottom - C.height
width of signal area = width of bottom axis
height of signal area = height of left axes
If the number of signals (axes) changes, the width of (B) changes, so that signal area has more or less space (width).
The grid is always painted in the signal area's rectangle only.
All font sizes, margins and rectangle values (left/top/right/bottom, width/height) are pixels MULDIV'd with screen DPI.
In your example (
https://www.steema.com/support/viewtopi ... 289#p81015) I do not understand how to calculate the values dynamically if the number of axes changes.
In the example:
...Chart1.MarginLeft:=15;
...Chart1.CustomAxes[1].PositionPercent:=-10;
These values are okay for the current situation, two axes -- the chart gets a margin of "15" (unit? percent? of what?) for its left side and the custom axes are moved with negative relative offset (-10).
Why -10? Because it looked best after testing some values? Or was that value somehow calculated from font size and other parameters?
Is the -10% offset from the width of the chart? If so, if the left margin of the chart changes (15->20) the -10% offset of axes position will result in a different absolute offset (because the width of the chart is smaller than with left-margin=15). So the axes will have a smaller (absolute) width? I want the axes to have a fixed width depending on font size, tick length and margins (distance text to border, distance text to tick lines).
Thanks for your patience!
