Bug 379100 - generate data from function does nothing
Summary: generate data from function does nothing
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: 2.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-23 00:24 UTC by Uwe Stöhr
Modified: 2017-12-20 22:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.5


Attachments
screenshot for the "2*x" action (136.66 KB, image/jpeg)
2017-11-19 22:10 UTC, Uwe Stöhr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stöhr 2017-04-23 00:24:01 UTC
- install LP 2.4 under Windows
- create a new spreadsheet
- generate data from a function and use as function for example "2*x"

result: nothing happens

Then I thought it is because all values are "-" (empty). Therefore

- fill the column with row numbers
- generate data from a function and use as function for example "exp(x)"

result: the content of the column is emptied
Comment 1 Stefan Gerlach 2017-04-23 14:23:11 UTC
* works on Linux
* "x" works, "2*x" and "exp(x)" does not
Comment 2 Uwe Stöhr 2017-11-12 21:23:20 UTC
This bug is also in LP 2.5RC2.
Comment 3 Stefan Gerlach 2017-11-18 09:41:10 UTC
I can not reproduce this bug in 2.5RC2 on Windows using exp(x) on row numbers.
Can you give a more detailed description and a screenshot to find the problem?
Comment 4 Uwe Stöhr 2017-11-19 22:10:29 UTC
Created attachment 108970 [details]
screenshot for the "2*x" action

This is still the case with LP 2.5RC2, see attached:

> - create a new spreadsheet
> - generate data from a function and use as function for example "2*x"
> 
> result: nothing happens

The exp(x) error I reported in the initial comment is indeed now gone.
Comment 5 Uwe Stöhr 2017-11-19 22:14:05 UTC
Ah, now I understand. The 2*x action fails because the column doesn't yet have row numbers.

To solve this problem one should disable the generate from function feature if the column is empty and add a tooltip for the user when he wants to use this function, that he needs to fill the column with values at first.
Comment 6 Alexander Semke 2017-12-20 22:20:48 UTC
Git commit 25e1c67b45455229c106f582c152a973c452b1e0 by Alexander Semke.
Committed on 20/12/2017 at 22:20.
Pushed by asemke into branch 'master'.

1. don't allow to select non-numeric columns and numeric columns without any values in FunctionValuesDialog
2. don't allow to select non-numeric columns as the data-source column in curve docks.
FIXED-IN: 2.5

M  +7    -7    src/backend/core/AbstractColumn.cpp
M  +1    -1    src/backend/core/AbstractColumn.h
M  +5    -3    src/backend/core/AbstractColumnPrivate.h
M  +34   -6    src/backend/core/AspectTreeModel.cpp
M  +4    -0    src/backend/core/AspectTreeModel.h
M  +2    -2    src/backend/core/abstractcolumncommands.cpp
M  +54   -29   src/backend/core/column/Column.cpp
M  +1    -2    src/backend/core/column/Column.h
M  +4    -1    src/backend/core/column/ColumnPrivate.h
M  +1    -1    src/backend/core/column/ColumnStringIO.cpp
M  +1    -3    src/backend/worksheet/plots/cartesian/XYCurve.cpp
M  +2    -0    src/kdefrontend/dockwidgets/XYCurveDock.cpp
M  +3    -1    src/kdefrontend/spreadsheet/FunctionValuesDialog.cpp

https://commits.kde.org/labplot/25e1c67b45455229c106f582c152a973c452b1e0