Bug 163727 - Save to file does not work for histogram chart
Summary: Save to file does not work for histogram chart
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Devansh Varshney
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Histogram-Chart
  Show dependency treegraph
 
Reported: 2024-11-02 00:47 UTC by kurt.nordback@protonmail.com
Modified: 2025-04-07 15:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kurt.nordback@protonmail.com 2024-11-02 00:47:49 UTC
Description:
Current code allows creating a simple histogram chart in the UI. However, saving the file loses the chart contents (in both ODF and OOXML). 

Steps to Reproduce:
1. Select some data in a spreadsheet.
2. Select "Insert", then "Chart", then "Histogram". A histogram chart appears.
3. Save the file, as ODF or OOXML.
4. Close and re-open the file.

Actual Results:
The chart region is still shown, but the chart contents are lost.

Expected Results:
The chart appears as it was initially created.


Reproducible: Always


User Profile Reset: No

Additional Info:
Here are the contents of the xl/charts/chart1.xml file produced when saving to OOXML. Note that there's a <chart> element but no actual chart within it.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

  <c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <c:lang val="en-US"/>
    <c:roundedCorners val="0"/>
    <c:chart>
      <c:autoTitleDeleted val="1"/>
      <c:plotArea>
        <c:spPr>
          <a:noFill/>
          <a:ln w="0">
            <a:solidFill>
              <a:srgbClr val="b3b3b3"/>
            </a:solidFill>
          </a:ln>
        </c:spPr>
      </c:plotArea>
      <c:legend>
        <c:legendPos val="r"/>
        <c:overlay val="0"/>
        <c:spPr>
          <a:noFill/>
          <a:ln w="0">
            <a:noFill/>
          </a:ln>
        </c:spPr>
        <c:txPr>
          <a:bodyPr/>
          <a:lstStyle/>
          <a:p>
            <a:pPr>
              <a:defRPr b="0" sz="1000" strike="noStrike" u="none">
                <a:uFillTx/>
                <a:latin typeface="Arial"/>
              </a:defRPr>
            </a:pPr>
          </a:p>
        </c:txPr>
      </c:legend>
      <c:plotVisOnly val="1"/>
      <c:dispBlanksAs val="zero"/>
    </c:chart>
    <c:spPr>
      <a:solidFill>
        <a:srgbClr val="ffffff"/>
      </a:solidFill>
      <a:ln w="0">
        <a:noFill/>
      </a:ln>
    </c:spPr>
  </c:chartSpace>
Comment 1 raal 2024-11-04 16:40:53 UTC
Confirm Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b0195d40f3abc343b88f767f4fe109a9c1d44347
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 2 m_a_riosv 2024-11-07 12:45:17 UTC Comment hidden (obsolete)
Comment 3 m_a_riosv 2024-11-07 12:54:53 UTC Comment hidden (obsolete)
Comment 4 kurt.nordback@protonmail.com 2025-04-07 15:07:27 UTC
I'm working on infrastructure for OOXML input/output of chartex charts. See https://bugs.documentfoundation.org/show_bug.cgi?id=165742. So I'd recommend waiting on the OOXML side of this until that bug is done. The bug I reference doesn't address the ODF side, though.
Comment 5 Devansh Varshney 2025-04-07 15:29:50 UTC
(In reply to kurt.nordback@protonmail.com from comment #4)
> I'm working on infrastructure for OOXML input/output of chartex charts. See
> https://bugs.documentfoundation.org/show_bug.cgi?id=165742. So I'd recommend
> waiting on the OOXML side of this until that bug is done. The bug I
> reference doesn't address the ODF side, though.

I am aware of it, I do look at your patches for the OOXML to understand how are we  taking the direction.

But there is other situation with the Histogram chart that originally we were overwriting the values-y with the calculated bin values which eventually made the loss of original values. So, we have to preserve the values-y. So the situation is much deeper for both ODF and OOXML.

So, after a discussion with quikee he came-up with an approach of having a new datasequence calulcated-y which can store this calculated bin values.

While making, it prioritizes for the chart to use them if they are present.


---------------------------------------

This is what the current situation is - https://www.youtube.com/watch?v=Z9i89GmSa08

maybe patch 19? - https://www.youtube.com/watch?v=bn4y8K953Lo

https://gerrit.libreoffice.org/c/core/+/182101

I did not touch the code since 2 days, I went on making some fall back handling changes in the BubbleChartDataInterpreter which I have stashed as of now.