Hi Team,
I have a requirement where I need to reduce the height of custom ruler and make it fit within the graph area.
Is there any option to achieve the same?
When I tried to reduce the x and y values the custom ruler does get shorten but its draggable all over the graph which I am unable to avoid.
Need your suggestions on this
AIMPED
April 21, 2025, 7:02am
2
Hey @Sharath How did you create the ruler?
Hi @AIMPED I am using a custom function called custom ruler which has the following code:
drawLineShape(initialX, initialX, 5000, -5000, “x”, “paper”); //function call
//function body
const drawLineShape = (
x0: number,
x1: number,
y0: number,
y1: number,
xref: any,
yref: any
): LineShape => {
return {
type: “line”,
x0,
x1,
y0,
y1,
xref,
yref,
line: {
color: “#333 ”,
width: 1
}
};
};
AIMPED
April 21, 2025, 7:27am
4
You can change the reference for your coordinates to something different than paper
.
Figure
Maybe helpful:
Hello,
I am having a hard time understanding the difference between “paper” and “x domain”. I am showing two examples below. When would they be different? Thanks.
Example 1: Below are two rectangles plotted using xref = ‘paper’ & xref = ‘x domain’ and they plot exactly on top of each other.
[image]
Example 2: Below are two text annotations set to the same x value and slightly different y value to not overlap them. As seen in the graph, both start at the same x-coordinate.
[image]