Lock A Bone To a Slope Angle
You could use a transformation constraint. Where a copy transform constraint always connects the same axis between bones at a fixed ratio, the transformation constraint allows you to mix axes and ratios.

In this example, I have set the X location of the target bone to control the Y scale of the slope bone.

The mapping in the middle is set to have the X axis affect the destinations Y axis.

The minimum location of 1.0 will map to the minimum scale of 0.5 and the maximum location of 4.0 will map to the scale of 2.0. I chose these amounts visually to keep the alignment of the bone over the distance.



That gives the following result, note that enabling the extrapolate option will extend the result past the given limits.





Also note that constraints are really just a visual way of configuring a premade list of drivers, you can configure your own drivers to get more control if you wanted to.