Bug 150815 - Sparklines do not recalculate immediately with changed data
Summary: Sparklines do not recalculate immediately with changed data
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All Windows (All)
: medium minor
Assignee: Tibor Nagy
URL:
Whiteboard: target:24.2.0 target:7.6.2
Keywords: implementationError
Depends on:
Blocks: Sparklines
  Show dependency treegraph
 
Reported: 2022-09-05 21:51 UTC by Skip Masonsmith
Modified: 2023-09-02 12:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sparkline test (8.05 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-09-07 16:15 UTC, Skip Masonsmith
Details
Sparkline not updating in 7.5alpha x86 64 (3.06 KB, image/png)
2022-09-07 19:50 UTC, Skip Masonsmith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Skip Masonsmith 2022-09-05 21:51:19 UTC
Description:
Sparklines will not recalculate unless you double-click on the cell containing the sparkling or you do Data > Calculate > Calculate Hard... regular recalculate is insufficient to trigger the change.
Ideally, these would recalculate when data in the Sparkline data range is changed.

Steps to Reproduce:
1. Create data in a new spreadsheet: A1: 1, B1: 2, C1: 3
2. Insert Sparkline using the data A1-C1 as the input range. 
3. Change B1 to 5
No change in Sparkline...
4. Press F9 or go to Data > Calculate > Recalculate



Actual Results:
No change in Sparkline...

Expected Results:
Updated Sparkline.


Reproducible: Always


User Profile Reset: No



Additional Info:
Bonus finding... After a chart is created on the same sheet (it doesn't even have to reference the same data) F9 / Data > Calculate > Recalculate *will* update the Sparkline if data in its data range has changed.
Comment 1 Roman Kuznetsov 2022-09-07 14:49:01 UTC
No repro in

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3e544b6938ee509a4f6df4c2e2996d71ce072506
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded
Comment 2 Roman Kuznetsov 2022-09-07 14:50:56 UTC
Please check Data->Calculate->Autocalculate . Is it enabled in your LibreOffice?
Comment 3 Skip Masonsmith 2022-09-07 16:15:07 UTC
Created attachment 182286 [details]
sparkline test
Comment 4 Skip Masonsmith 2022-09-07 16:15:55 UTC
Autocalculate is enabled.  Created new file and reproduced error, attached.
Comment 5 raal 2022-09-07 19:12:54 UTC
No repro with Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 64f673238cf9b645a751e8f8137ca14e595a779a
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

Please can you test with dev version? You can download it here:
http://dev-builds.libreoffice.org/daily/master/
Thank you
Comment 6 Skip Masonsmith 2022-09-07 19:50:02 UTC
Created attachment 182292 [details]
Sparkline not updating in 7.5alpha x86 64

Reproduced in 7.5alpha x86 64
Image shows sparkline with 1-2-3 graph of original data instead of 1-5-3 updated data.
Comment 7 Roman Kuznetsov 2022-09-08 07:05:38 UTC
I confirm the problem when the sparkline is bottom than its data
If you create the sparkline right from the data - works fine

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3e544b6938ee509a4f6df4c2e2996d71ce072506
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

Tomaz, could you look at this please?
Comment 8 Roman Kuznetsov 2022-09-08 07:07:09 UTC
MS Excel updates those sparklines fine
Comment 9 Roman Kuznetsov 2022-09-08 07:11:35 UTC
try collapse Calc window to the task bar and then restore it back at once -> sparklines bottom of its data look as should
Comment 10 Timur 2022-09-08 09:17:07 UTC
Win only, no repro in Linux for me.
Comment 11 aplatypus 2022-09-17 14:30:35 UTC
* This bug might be related to the 'Sparkline rules' (or limits) that I've seen.  

* I have had different examples of what I think of as valid formulae Not work with Sparklines.
* I have determined that Sparkline only work for...

* A contiguous cell range
* Must include worksheet name
* cell reference must be absolue:
  x "'daily summary'!U76:X76" -- worked, but:
  x "$U$76:$X$76" -- fails
  x "$U$76,$V$76,$W$76,$X$76" -- fails
  x "U76,V76,W76,X76" -- fails

* I've also seen the recalc work perfectly well (v7.4.1.2) when the rules are adhered to.

* I have 4 cells with values used for a Sparkline: "'daily summary'!U76:X76"
* X76 references another cell: "=R[-7]C9".  I changed value for "R[-7]C9" from 200 to 2,000 -- Immediate graph update
* Also, I changed value of X76 directly from 200 to 1,000 -- Immediate graph update


I thought these examples that work might help understand what's happening.  I too have seen the autorecalc not work.  When I looked, the cell was a copy and it was pointing to the original cells -- Cells that had not changed.

* I think in this case you wanted to see $B$5 not B5
Comment 12 David García 2023-05-25 17:08:13 UTC
Hi,

I have noticed the same problem on Libreoffice 7.5.3.2 (x64) for Windows. These are my thoughts:

1. Autocalculate is on, but it doesn't work.

2. Recalculate doesn't work.

3. Recalculate Hard does work.

4. I didn't know, until I read this thread, about the Recalculate features and I don't know exactly what they are for, but I would have presumed that every time the content of a cell changes, a sparkline (or any element of a spreadsheet) gets automatically updated.

5. Other ways to update a sparkline would be to: a. close and open the document; b. switch to a different sheet and then go back to the original sheet.
Comment 13 Commit Notification 2023-08-31 16:01:44 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d1411afab98f7b41e9e700ef26b43dc77242d917

tdf#150815 sc: fix repainting sparkline

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2023-09-01 11:35:07 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/009ea5c6bcf34b877dddfe4080b9bb2450844adb

tdf#150815 sc: fix repainting sparkline

It will be available in 7.6.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.