Issue 121231 - Charts in spreadsheet: Allow changing from internal table to data range and vice versa
Summary: Charts in spreadsheet: Allow changing from internal table to data range and v...
Alias: None
Product: Calc
Classification: Application
Component: ui (show other issues)
Version: 3.4.1
Hardware: PC Windows 7
: P3 Major with 4 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact: saisyamala
Keywords: regression
: 120191 125930 (view as issue list)
Depends on: 118840
  Show dependency tree
Reported: 2012-10-18 11:58 UTC by adrian
Modified: 2017-05-20 10:44 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.1
Developer Difficulty: ---

Spreadsheet, the above bug report concerns adding the chart for December 2012 (117.32 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-10-18 11:58 UTC, adrian
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description adrian 2012-10-18 11:58:44 UTC
Created attachment 79791 [details]
Spreadsheet, the above bug report concerns adding the chart for December 2012

I keep daily weather data in a spreadsheet. Each month carries a graphical summary as an inserted chart, taking X-axis data from one column and the relevant data from another. 

Each month I copy and paste the previous month's chart to the new month and then alter the data ranges to correspond to the required rows. 

I have just upgraded OO from 3.2.0 to ver 3.4.1 and the above method no longer works. I can cut and paste OK but when I edit the copied chart I am unable to access Data Ranges at all, either in the edit menu or by clicking Format (Data ranges is greyed out). 

Moreover, if I attempt to insert a new chart from scratch, the X-axis only displays part of the series, and on saving and re-opening the chart is minimised to a thumbnail. 

Giant steps backwards as far as I am concerned !
Comment 1 hanya 2012-10-18 12:26:09 UTC
This is caused by the same reason described in issue 118840.
Comment 2 saisyamala 2013-02-05 16:43:04 UTC
I tested this in version 3.5.0 and as mentioned the cells when copied to another spread sheet do not let you edit them. Also, when tried to click on any cell, the  data in the cells all turned to "err:599".
Autoformat is greyed out in format tab when the cells are copied to a new spreadsheet.
Comment 3 Armin Le Grand 2013-06-12 10:43:48 UTC
ALG: #118840# is fixed, but it does not help here. In general, a chart which is copy/pasted in any way will get it's own internal data table. Currently I know of no way bach from this. It would be necessary to have something (in calc only) when the chart is in edit mode to allow deleting the internal data table and allow to add a data range. I am not a chart/calc specialist, maybe this is somehow possible.
Thus I would change this one to an enhancement request and change the title accordingly.

Request: For an activated Chart (in edit mode) in Calc, allow the user to change from internal data table to data range and vice versa:
- When chart has an internal data table, allow deleting by defining a data range
- When chart has a data range, allow conversion to internal data table (including copying the data from chart to table)
Comment 4 Andrea Pescetti 2013-06-12 11:07:41 UTC
But this is a regression, so I'm not sure we can qualify it as ENHANCEMENT.

I mean, it used to work correctly in old versions and there are multiple reports around, all with the schema suggested by the original poster (a chart, like a monthly report, that has a fixed layout and is expected to be copied and linked to new data periodically). So probably some new code in 3.4.x broke this usage pattern.
Comment 5 Armin Le Grand 2013-06-12 12:27:55 UTC
ALG: AFAIK from the source this is happening for some time, probably since #i103911# was added, this was somewhere around 2010-04-23 08:14:16 UTC when looking at the task. That task would have to be taken back then, too.
Already happens with 3.4 and 3.4.1. Checking OOo3.3...
Comment 6 Armin Le Grand 2013-06-12 13:31:20 UTC
ALG: Works in OOo3.3, thus it was introduced with CWS chart45 on the way to OOO3.4, still in the Oracle phase. Not a regression on AOO side (what does not help with the task, though).

The problem is that the fix which lead to this basically always copies the data to local data in the chart during copy/paste. #118840# was a result, in the case that the sheet was named 'Sheet1' this was not working; that's what I fixed.

The missing step is to
- either detect that the data is available via xDataProvider after paste and remove the internal one
- or offer the user edit possibilities to go back to a range if intended

The point is that the new behavior is to copy the data locally to the chart as default (which cannot be avoided since this decision has to be made at copy-time, not at paste time, thus the target is not known and also not if the target is the same as the source). Seen from that basically changed behavior adding the missing step is an enhancement.

But I see your point, maybe just let it on regression. Maybe I oversee something basic, too, I'm not a calc/chart specialist...
Thus, back to defect.
Comment 7 adrian 2013-06-12 13:44:22 UTC
I think the point may have been missed.  Some of these charts are complex and time-consuming to set up.  Copying an existing chart is therefore the simplest method of replicating it (or them) month by month.  I am really not fussed about which data is brought over into the pasted chart;  I am quite happy for it to be an exact copy.  The problem is that there is no way to access DATA RANGES when the copied chart is edited.  It is a relatively simple matter in 3.2.1 build 9502 to Edit, click on Data Ranges and then alter the scope of the data cells to be displayed.  Takes just seconds.
Comment 8 Armin Le Grand 2013-06-12 14:18:28 UTC
ALG: Hi Adrian, no, the point is not missed, it's clear and I agree that it's easier to copy the chart. The problem is that other fixes have lead to copy the chart with integrated original data (e.g. when copying to another app, all cases where the data is not accessible using the range description). That's why i propose to:

- either detect that the data is available via xDataProvider after paste and remove the internal one
- or offer the user edit possibilities to go back to a range if intended

as written in comment 6. That would solve the problem.
Comment 9 Armin Le Grand 2013-06-19 13:18:52 UTC
*** Issue 120191 has been marked as a duplicate of this issue. ***
Comment 10 Armin Le Grand 2013-07-02 14:07:52 UTC
ALG: Grepping. Some (self-)comments: #118840# made data to be contained by detecting the calc model used as temporary since these also have 'Sheet1' as name of first sheet, thus avoiding copying/including local data. This could be replaced/fixed different by:


        ScDocument* pDoc = (*ScGlobal::pDrawClipDocShellRef)->GetDocument();
        SCTAB aTableCount(pDoc->GetTableCount());
        String aString(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("_temporary_")));
        pDoc->RenameTab(0, aString);

Thus would guarantee the 1st sheet of a temporary ScDocument to have an alternative name, older fix may be removed. Checked, but still does not save the original data ranges; I need to follow where these will stay in the further processing.
To allow re-defining the chart to have a range, a start point is ControllerCommandDispatch::updateCommandAvailability in chart2, ".uno:DataRanges" (l610) should beindependent from m_apModelState->bHasOwnData...
Comment 11 oooforum (fr) 2014-12-08 13:48:52 UTC
*** Issue 125930 has been marked as a duplicate of this issue. ***
Comment 12 oooforum (fr) 2014-12-08 14:10:03 UTC
Still present in 4.1.1
Comment 13 Regina Henschel 2014-12-13 12:33:55 UTC
I don't think issue 125930 is a duplicate, see my comment #c4 there. Nevertheless their fixes might be related and done together.
Comment 14 adrian 2015-05-16 14:07:40 UTC
Well, here we are some two and a half years later.  I have just downloaded the new Aoo version 4.1.1 and there has been no progress.  You still cannot copy a chart and then edit the Data Ranges to encompass a different data set.  Not impressed !  Still stuck on v3.2.1 and that doesn't work with Java runtime.  Blah !
Comment 15 Marcus 2017-05-20 10:44:21 UTC
Reset the assignee to the default "".