[Libreoffice-bugs] [Bug 62925] FORMATTING: enhancement: please add "chart styles" to the styles of Calc

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jun 2 11:27:28 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=62925

--- Comment #39 from Zak McKracken <Zak.McKracken at gmx.de> ---
I'm quite interested in having styles for charts, as that could make LO a lot
more efficient to work with. I'm usually quite busy generating plots, rather
than discussing software, but I'm finding myself with a few weeks' time, so I'd
be interested in helping out if/where I can.

I've not programmed anything in C++ (but am reasonably seasoned in Python,
including GUI programming, if that helps at all), and I've been using all sorts
of graphing software in the past, from Excel annd openOffice 1.0 through
Libreoffice 6, Paraview, Fieldview, Tecplot, Matplotlib, Gnuplot ... so I'd
like to think I have some capacity to compare their implementations of
formatting templates.

I'm not sure where the process is at the moment, and if the below helps (if
not, feel free to ignore), but I thought it might be useful to give some more
examples of how this works in other software, both as an inspiration and maybe
also as an indication of how useful a feature it can be.

Tecplot is one of the biggest players in the scientific plotting market, so I
think taking a look and learning from them is reasonable. And actually, I think
it's fairly straightforward to improve on their approach, although it's
reasonably good, in that it stores plots as "layout" files, which contain the
formatting separate from the data (and can even have it in separate files), and
allows replacing a layout but keeping the data, or replacing data and keeping
the layout. Layouts are specified in some kind of scripting language (the same
it used for user scripts), which can include formatting of non-existent
elements. Although this is (sadly!) not officially supported, the default
formatting choices are stored in a user-editable file and with a little trial &
failure, a user can edit this to include their most frequent formatting
choices. This used to be a huge time saver for me until the next version broke
compatibility...).
pros:
* keep data, change layout
* can be used to get good defaults
* layout can have settings for all plot types and elements, independent of
whether they're visible in a particular plot. So if you format a line plot,
then switch to scatter, the line-plot formatting is still there.
cons:
* editing global defaults is tedious
* layout choices are specific: Over-loading another layout changes only
elements present when layout was specified (i.e. if there are 3 data series in
the data but only 2 in the layout, the third will use global default style -- a
layout can't specify "all plotted lines have thickness X", except in global
defaults)


Another example: Matplotlib, the core plotting library for Python. It has next
to no GUI, and is used via Python code, but I like the principle it uses. In
most cases when I used it (and having been confined to Python 2.0 with no time
to read the docs properly), I always copied a bunch of formatting code around
to get consistent looks for my plots (still a time saver vs. having to remember
the arguments for plotting functions...), but in current implementation, style
sheets are a blessing:
https://matplotlib.org/3.2.0/gallery/style_sheets/style_sheets_reference.html
They define all possible elements (or a subset of them), and allow visually
consistent plots of all kinds without specifying the same formatting choices
for all of them over and over again. There's a set of style sheets that comes
with matplotlib, but the user can make and specify their own.
This means that I can generate publication-ready plots much quicker, and if
different forms of publication require different formatting, that's only one
update to the style sheet, and re-running the script to generate the charts.
Very little work, and no way to accidentally forget to change that one axis
label...

Pros:
* ... everything. I think this is my favourite implementation of styles for
plots. Matplotlib can control pretty much anything ever using them (as far as I
have explored it so far). If someone made all matplotlib functionality
available in a good GUI with saving/loading of graphs and data, that would be
my favourite graphing software, by a long shot.

Cons:
* ...small nitpicks. I've written too much already.


Feel free to contact me if you think I can make some useful contribution.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200602/f16efb02/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list