How do I change part of the background on a (blood sugar level) line chart

I wish to have a line chart showing a simple 2 column data range (Date, Blood Sugar Level). In addition I wish to have the background of the chart to hignlight the acceptable range of what the blood sugar level should be, i.e. a data range of between 4 to 7 for all dates to be light grey. I should then end up with a graph that shows the acceptable range in grey and for the line graph to sit on top of this - easily identifying when the line chart data exceeds to acceptable range.

Can anyone help me please?

regards
NeilS

(LeroyG added “blood sugar level” to title, so it is easy for others to find it)

Can this help?


https://ask.libreoffice.org/t/i-have-a-series-of-3-numbers-2-blood-pressure-and-1-pulse-how-can-i-create-a-graph-to-see-how-they-relate/15397

I did never find a way to do that within a chart definition. My solution was to overlay the chart area using a transparent rectangle and to group the objects. But: Such solution does not satisfy professional layout requirements and would look like this:

image description

(personally preferred a green color :wink: )

Just a tip:

Maybe it is enough to apply two helper lines at the Y value 4 and 7 (add two columns to the Data Range with constant values.)

1 Like

EDIT:

A third option (a bit better one, but that also does not respect the time scale) could be to use the chart type Stacked Columns and Lines.

Normal Low column (with value 4) in white, Normal High column (with value 7-4) in gray, and Blood Sugar Level as line.

Column spacing is set to 0% and borders style to none.

image description


A fourth option (that respect the time scale), is to use the XY (Scatter) Chart Type, and put a second line midway between 4 and 7 (the acceptable range), with a wide Width.

If the Y axis scale is not set to specific values, it is quite possibly that, at some point, it would be necessary to adjust this width.

The same applies to the white spaces to the left and right of the chart, if X axis scale is set to automatic.


Seem that my previous answer (below) points to a diastole-systole chart. :frowning: /EDIT.

The not so easy way: Use a Stock Chart 2 type.

image description

Set first column as label.

Once done, edit and…

  • Format Stock Gain Border to none, Area Color to gray and Transparency to 50%.
  • Format Data Series Line width to 1 mm

See sample file (with no real data).

The hard way: In a XY (Scatter) chart, add a white rectangle shape as a background replacement, a grey rectangle shape in front of the white one, and place in top of them the chart with the chart area set to none, and fix the Y axis. Once the three are in place, group them.

image description

Made with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.


Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.

Check the mark (Answer mark → Correct answer mark) to the left of the answer that solves your question.

1 Like

Correct sample file added.