[Solved] Different bar colors for positive/negative numbers

Discuss the spreadsheet application
Locked
Lt2210
Posts: 3
Joined: Fri Sep 27, 2024 4:03 pm

[Solved] Different bar colors for positive/negative numbers

Post by Lt2210 »

I have a bar chart to show the monthly profit/loss of an item. I would like the bar colors to be blue for positive results and red for negative results. Is there a way to format the bars for this?
Last edited by Hagar Delest on Sat Feb 08, 2025 10:24 pm, edited 1 time in total.
Reason: tagged solved.
OpenOffice 4.1.13 on Windows 11 Home
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Different bar colors for positive/negative numbers

Post by Lupp »

You may have a look into the attached example.
aoo112472_ColumnChartColors.ods
(18.15 KiB) Downloaded 85 times
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Lt2210
Posts: 3
Joined: Fri Sep 27, 2024 4:03 pm

Re: Different bar colors for positive/negative numbers

Post by Lt2210 »

Re: Lupp Thank you! Your chart was EXACTLY what I needed!
OpenOffice 4.1.13 on Windows 11 Home
cwolan
Posts: 214
Joined: Sun Feb 07, 2021 3:44 pm

Re: [Solved] Different bar colors for positive/negative numbers

Post by cwolan »

@Lupp

There is a note in your .ods file: I don't know a way to center the columns for both series with respect to the grid/labels.
If I get it right, one could in this particular case:
  • set Overlap to 100% (the Data Series dialog, Options tab)
    or
  • use the Stacked subtype of the Column chart type
Attachments
ColCenter.ods
(88.17 KiB) Downloaded 56 times
OpenOffice 1.1.5 – 4.1.16
LibreOffice 3.3.0.4 – 26.2
Windows 7,10,11 64-bit
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Different bar colors for positive/negative numbers

Post by Lupp »

cwolan wrote: Mon Feb 10, 2025 11:12 am @Lupp
There is a note in your .ods file: I don't know a way to center the columns for both series with respect to the grid/labels. ...
Thanks. Overlap 100% did the trick. I never had noticed the Overlap setting.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Locked