# How to get hatching on an LO Calc diagram. See my try

On a Calc diagram, with an affine curve (y = ax +b),
I would like to point out that a space above or below is not a solution.

Usually, this is done with hatching.

How to obtain hatching above or below a curve (in a very simple way ).

See my test (with two curves), which isnâ€™t easy. I created a new line for each hatch, with a test to be above or below the curve,
LibreOffice Calc hatch diagram test 2023.ods (33.9 KB)

Update. I need to mention that the area with hatching is in connexion with the curve :).
I am not looking for a background

hatch.ods (16.0 KB)

Have you tried to create a shape (with hatched area) in Draw and overlay it over you Calc chart?

@Villeroy
I believe that OP wants a hatch under some sub-area of the chart, not a global background.

Hello @Villeroy
I am not sure to have seen what you want to share with your file.

No curve, just a background?

@ajlittoz
I understand, but how to make this overlay in connection with the curve?

I am looking for a dynamic area. If I modify the curve, the hatching area has to change dynamically.
It is the case with my file :).

Imagine the case with a hyperbole and an affine :).

You canâ€™t relate a Calc chart and a Draw shape because you canâ€™t derive a Draw shape from some parametric model. This is the weak point of my suggestion: you must reproduce your curve â€śby handâ€ť in Draw.

A silly idea (but why not ?): there is a parametric module in FreeCAD based on a integrated spreadsheet. Since FreeCAD shapes are controlled by parameters (which can be references to the local spreadsheet), this could be a lead. But the shapes there cannot be fully arbitrary math shapes. Polynomial and trigonometric curves should be accepted.

1 Like

Do you mean: let the red hatch lines be connected to the red curve?
For this task you need calculate and use some helper points (These are the intercept points of the hatch lines and the curve for the Scatter graph).

1 Like

Hello @Zizi64
Yes. Did you try with my file?

Here is my idea with x-Error bar and y-Error bar. I just use some large constant or some calculated error values for the curves. In this case I have used the positive x/y-error values only.
I know these lines are horizontal and vertical lines, but they are not slanted. But they can show the common area of the curves.

1 Like

Hello @ajlittoz.
It is not a draw. Hatching are curves too :).
Theyâ€™re perpendicular because the â€śaâ€ť coefficient hatching multiply by the â€śaâ€ť coefficient of the main curve equal 1 :).
Did you see my file?

Fantastic @Zizi64
You make it very simple!
Let me take a look at this.
But I think you propose an elegant solution

just kidding

Depended on the type of the curves you need apply some tricks.
For example: for the y = x^2/2-5 equation and for â€śhorizontal hatch below itâ€ť you must â€śdivideâ€ť the curve in two parts:
Hatch_Tricks.ods (27.4 KB)

1 Like

Great @Zizi64
You have proposed the best solution

Thank you, have a nice Sunday.

As a workaround, choose an Area chart, format lines and areas accordingly, copy and paste in Draw, and there delete some points and move others.

LibreOffice Calc hatch diagram test 2023 LeroyG.ods (26.5 KB)
LibreOffice Calc hatch diagram test 2023 LeroyG.odg (38.0 KB)

2 Likes

Hi @LeroyG, thank you for your time.
I am sure that is the answer.
If you have a new formula you need to replay with Draw.
See the answer from @Zizi64, itâ€™s dynamics, you can modify your curve without playing with Draw.