Closed GoogleCodeExporter closed 9 years ago
The issue seems to be the following:
Chart mode checks for number-column-types such as integer, float or real.
If we do PRAGMA table_info(viewname) on a view, the type of the SUM()-column is
unknown (empty), so phpLiteAdmin does not propose it as a valid value-column.
I think checking for some hard-coded column-types is not such a good idea
anyhow, because SQLite is very weakly typed and people might use "smallint" as
a column-type (although it does not have the usual semantics as normally in
SQL, SQLIte will accept it). Maybe we should drop the check completely and rely
on the user to choose columns that work? I mean, the user could enter strings
in an integer column anyhow (in SQLite), so the check does not prevent things
from breaking anyhow.
Original comment by crazy4ch...@gmail.com
on 27 Feb 2013 at 5:29
There are 2 almost-the-same-lines that look like this:
if(strtolower($result[$i][2])=="integer" ||
strtolower($result[$i][2])=="float" || strtolower($result[$i][2])=="real")
The first picks the initial value-column and the second one filters the list of
possible value-columns.
I think we should remove the 2nd one and leave it up to the user to choose
reasonable columns.
We might leave the first there as it makes sense to pick a numeric column as
default. But if there is no numeric column, we should probably choose the next
"unused" column (not the same column as the label-column).
Original comment by crazy4ch...@gmail.com
on 27 Feb 2013 at 5:33
Agree with #2. Choosing a nonsense (non-numeric) column as a value results in
an error message, so the bad choice is noted & can easily be corrected by the
user.
Original comment by gba...@gmail.com
on 27 Feb 2013 at 6:25
I just fixed this issue with r344.
It is now possible to select any column as value-column.
However, a column of a numeric type is chosen as default, if such a column
exists. If none exists, the first column is chosen that is not the label-column
(if there is more than 1 col).
In contrast to previous versions, the default now picks the first column of a
suitable type and not the last one.
Original comment by crazy4ch...@gmail.com
on 1 Mar 2013 at 12:06
Original issue reported on code.google.com by
crazy4ch...@gmail.com
on 27 Feb 2013 at 5:29