After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 417631 - Rich chart text (labels, titles etc.)
Rich chart text (labels, titles etc.)
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Charting
git master
Other All
: Normal enhancement
: ---
Assigned To: Jean Bréfort
Jody Goldberg
: 425160 524029 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-12 21:16 UTC by Luke Hutchison
Modified: 2011-08-06 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tentative patch (1.46 KB, patch)
2011-08-03 17:53 UTC, Jean Bréfort
none Details | Review
first patch. (861 bytes, patch)
2011-08-04 11:24 UTC, Jean Bréfort
committed Details | Review

Description Luke Hutchison 2007-03-12 21:16:27 UTC
It would be great if charts could include formatted text, whether in the form of HTML tags entered into the chart properties dialog, or a reference to a cell containing formatted text.  It is often important to be able to add italics, superscript/subscript etc. to graph labels/titles in scientific publications.  Right now the only way to get this is to export the charts and edit them in Inkscape.
Comment 1 Emmanuel Pacaud 2007-04-01 19:01:25 UTC
*** Bug 425160 has been marked as a duplicate of this bug. ***
Comment 2 Jean Bréfort 2008-03-24 07:14:53 UTC
*** Bug 524029 has been marked as a duplicate of this bug. ***
Comment 3 Vladimir Chukharev 2011-05-31 12:39:18 UTC
Formatting in gnumeric is inconsistent now. Some of formats available in a plot are not available for cells, though mostly the problem is how cell contents are shown in charts. I want to collect here the problems I have encountered.

1. X-Axis1 of XY plot properties has no Format tab, while Y-Axis1 has. (It also differs by the names of ticks and lack of Type, but that is not about rich text ;-)
2. Custom format #EE0 for Y-Axis1, corresponding to Scientific with Use superscript is recognized by format for a cell, but leads to wrong rendering both in the cell and in the edit pane. They change to the value when F2 is pressed...
3. Meaning of + and - is different in different places of format strings for a cell and for Y-Axis1. One cannot use e.g. #0E00 for a cell, but it's OK for the axis. For a cell #0E-00 should be used instead, but this will show a dash before exponential (with possible sign) for axes. Look also at -0.00E+0 and +0.00E+0.
4. One cannot use small e as exponential sign (as in 0.0e+0), although corresponding numbers are recognized all right.
5. I could not find a format for a number been shown as 0.345E3 or .345E3 (pre-exponent between 0.1 and 1). ".000E-0" shows .450E2 instead. Notice a lost digit! My bet was on "#.0##E-0", but that gives 3.45E2.

My tests were done with 1.10.14 in FreeBSD, some checked in 1.10.15 Win7.

Wait! "#.0##E-0" gives .345E0 in 1.10.15, Win7. It changes behind the scene the format string to "#\.0##E-0" and then uses that...

Agrh... That's just difference of locales, comma is the floating point in that Win7... But still, silent change of . to \. is very surprising. Why not only . as the floating point indicator, likewise to 0 used for all digits? Well, you might have a reason, of course. I do not know what is XL-style format, anyway.
Comment 4 Andreas J. Guelzow 2011-05-31 14:21:58 UTC
Vladimir, you wrote in comment #3: "Some of formats available in a plot are not available for cells". Could you give an example of such a format?
Comment 5 Andreas J. Guelzow 2011-05-31 14:25:19 UTC
I guess #0E00 is one such example.
Comment 6 Andreas J. Guelzow 2011-05-31 14:31:14 UTC
No, that doesn't seem right. The format of the y-axis can be set to the format string #0E00 but it is still an invalid format and the y axis labels all become #####.
Comment 7 Vladimir Chukharev 2011-05-31 15:06:20 UTC
(In reply to comment #4)
> Vladimir, you wrote in comment #3: "Some of formats available in a plot are not
> available for cells". Could you give an example of such a format?

They all are similar to 0EE0 - the superscripts in numbers. That's what relates to rich text...
Comment 8 Andreas J. Guelzow 2011-05-31 16:16:04 UTC
For #EE0 in cells I have opened bug #651561 (since the cell rendering has nothing to do with charting.)
Comment 9 Vladimir Chukharev 2011-05-31 18:23:13 UTC
(In reply to comment #6)
> No, that doesn't seem right. The format of the y-axis can be set to the format
> string #0E00 but it is still an invalid format and the y axis labels all become
> #####.

Yeah, it's only about for #EE0 in axis and #E-0 in cell format..
Comment 10 Andreas J. Guelzow 2011-05-31 18:36:40 UTC
#E-0 seems to work fine for me in-cell as well as on-axis.
Comment 11 Andreas J. Guelzow 2011-05-31 18:38:29 UTC
Oh, which '-' is that? It should be U+002D HYPHEN-MINUS. Any other minus will be read as a literal symbol.
Comment 12 Vladimir Chukharev 2011-06-01 05:57:39 UTC
I was talking about normal -. In #E-0 for cells it has the same meaning as nothing (neither - nor +) in #EE0 for axis. But + or - is obligatory for cells.

I do not even remember now how to insert unicode symbols. I did use them, both in X and in Win, when needed often during some short period of time, but now cannot recall... Well, I know where to look for it or how to find symbols in system programs ;)

My vote would be on using normal '-' in format strings. And '.' for the floating point in all locales, even where ',' is used.
Comment 13 Andreas J. Guelzow 2011-06-01 07:57:49 UTC
I don't understand. What did you mean with the second clause in "For a cell #0E-00 should be used instead, but this will show a dash before exponential (with possible sign) for axes." Which "dash before exponential" do you see with respect to axes?
Comment 14 Vladimir Chukharev 2011-06-01 09:38:44 UTC
(In reply to comment #13)
> I don't understand. What did you mean with the second clause in "For a cell
> #0E-00 should be used instead, but this will show a dash before exponential
> (with possible sign) for axes." Which "dash before exponential" do you see with
> respect to axes?

I'm talking about consistency. In a cell format, a sign is mandatory (either + or -), while in axis format no sign means same as '-' in cell format, and '-' in axis format stands for itself. Actually, I was using formats with E for cells, and formats with EE for axis, in this test. And I use normal minus sign, not some unicode special minus symbol.
Comment 15 Jean Bréfort 2011-08-03 17:53:45 UTC
Created attachment 193196 [details] [review]
tentative patch

This patch has a lot of drawbacks, it uses the markup from the cell and:
- this overrides the style;
- when the markup changes but not the text, the labels are not updated until a redraw is forced;
- it looks a bit hacky.
Comment 16 Jean Bréfort 2011-08-04 11:24:39 UTC
Created attachment 193240 [details] [review]
first patch.

A much better solution, already commited so that things start working.
Comment 17 Jean Bréfort 2011-08-05 13:33:39 UTC
With latest development code, we now have rich text support for both scalar and vector data which makes things work with all sorts of labels we have, provided the data are cells refs.

It doesn't work if the text is directly typed in the graph data editor. It would probably be possible to make it work, but not easy, even for scalar data. I don't imagine implement that for vector data at all.

Any comment, or might I close this bug?
Comment 18 Jean Bréfort 2011-08-06 12:48:41 UTC
Labels also accept rich text entered as markup (html like defined at http://developer.gnome.org/pango/stable/PangoMarkupFormat.html). Probably not for the average user though.

I'm considering it fixed now.This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.