18 Commits
Author SHA1 Message Date
Dennis Francis 84129dd550 chart2: draw the correlation circle plot
Each series gives one arrow, from the origin to the point whose

1. x-coordinate value is the correlation of that series' feature column
   with the first dimension column.
2. y-coordinate value is the correlation of that series' feature column
   with the second dimension column.

A symbol marks the tip and the feature name sits beside it. The circle
of radius one and the two lines through the origin are drawn behind the
arrows, and both axes are held at minus one to one on a square plot
area, so a length in the picture means the same in both directions and
the circle stays round.

The correlations are worked out while the shapes are made rather than kept
anywhere, so they follow the cells they come from. Working them out needs the
whole of the three columns.

The correlation coefficient code itself is in a small header of its own
with a test beside it. It leaves out the instances where either side is
missing, and it has no answer for a feature that does not vary or for
fewer than two instances. A feature without an answer gets no arrow,
as there is no direction to point in.

Error bars, trend lines and area properties are turned off for this chart
type, since a point stands for a worked out pair rather than for a value in a
cell, and symbols are turned on because the tip of each arrow carries one. The
arrows take the line colour and width of their series, and the template asks
for thin ones, which is what keeps a crowd of them apart. The legend hands out
the same symbol as the arrow tip, so a key can be matched to an arrow.

Grids are turned off by default for this chart as the user is more
interested in the direction/angles and the magnitude of the "rays" from
the origin.

Change-Id: I2d8b3aa6ef7d66bd9deb1f63a647767a1b62ac90
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8103
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit e096bfee9c85a22e8b8155944a63ee9d6f72f75a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210465
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-03 19:32:19 +02:00
Dennis Francis b0b4bad01f chart2: add a correlation circle chart type
A correlation circle plot shows how each feature of a table relates to the
first two dimensions of a decomposition of that table, which a user can now
work out in a spreadsheet with MSVD. One point per feature sits at the
correlation of that feature with the first dimension across and with the
second dimension up, inside a circle of radius one.

The data arrives as one series per feature. Each series holds its own feature
column under the new role values-feature, together with the two dimension
columns under values-x and values-y, which every series shares the way the
bubble chart shares its x column. Keeping the dimensions on the x and y roles
means the point count, the axis scaling and the label machinery need no
special case, and the series label comes from the feature column header, so
the legend and the point labels read as feature names.

The interpreter reads a flat list of columns as a feature table followed by
two dimension columns: the last two are the dimensions and every column before
them is a feature. One range holds the lot, which is what the wizard hands
over, and it is also the order the list comes in when a chart of another type
is turned into this one. A first column of instance names is kept out of the
features when the range says it has them, as it is for a bubble chart.

Both dimensions are numbers running from minus one to one, so the chart type
joins the scatter and the bubble chart in asking for a numeric axis across.
That answer is also what turns the axis of names back into a numeric one when
a chart of another type becomes this one, since the coordinate system the
other type left behind is kept and reused.

Change-Id: Id17d3a2a235c849c3dab9768159ddf1608da6d05
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8102
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit b30d992bba26428941f47f952baf338df3763065)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209379
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-03 17:07:43 +02:00
Kurt Nordback 160014f44b Initial implementation of rendering for funnel charts
Framework for funnel chart rendering. For now this just renders them as
horizontal bar charts: that is, not properly centred as a funnel. UI
functionality is untested and probably broken.

Signed-off-by: Kurt Nordback <kurt.nordback@collabora.com>
Change-Id: I3a0e923b801c840138c90dcf3609253a467d23d1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7905
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 172e4233b70f1d73ca942876f3f47458843ffa36)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209739
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-25 08:52:54 +02:00
Arnaud Versini a94bce360d chart2 : use frozen::unordered_map to avoid allocations
Change-Id: I920ed50880c11cf516448fc4197cb86722d5e2f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205674
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2026-06-08 08:53:05 +02:00
Devansh Varshney 6829e82577 chart2: Implement Scott's Rule and Histogram Data Interpreter
This commit introduces the mathematical backend and data interpreter for
the Histogram chart, replacing the temporary raw value rendering.

- Adds HistogramCalculator, utilizing Scott's Rule to calculate optimal
bin widths and frequencies from raw data.
- Introduces HistogramDataSequence that listens to spreadsheet data
changes and automatically regenerates bin categories and frequencies
- Implements HistogramDataInterpreter to intercept raw values-y input,
and output the results into the calculated-y data sequence.

Change-Id: Iaf29ddd0b0824bd3f0808ffc91321cad9d5b877e
(cherry picked from commit 1ef619a998aba626d0ea7a9541109a7c9e145518)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1879
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit df68284255ccac4bd86583555986d9f7cbdddf9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203747
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-23 00:09:41 +02:00
Devansh Varshney 048b35b49d chart2: Add UI and basic rendering for Histogram chart
This commit introduces the structural foundation and user interface for
the new Histogram chart type. The rendering engine gracefully falls
back to plotting the raw values-y input data directly. As a result, the
chart currently renders identically to a standard bar/column chart.

- Adds UI entries in the Chart Type dialog.
- Adds HistogramChart to the view layer, inheriting from BarChart and
forcing a 0-gap width.

Change-Id: Ica5b15e9b7428d6c908e1b978259367fe8ff7aab
(cherry picked from commit 14a4a09b62fc283f9b629a2a317156efa6509054)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1878
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 508c3456e85a88771ac5e264cee9460274685a22)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203741
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-23 00:09:33 +02:00
Kurt Nordback ef9c1d57ad tdf#165742 Step 5.4: Add 'unsupported chart type' message
Add clearer handling for chartex types whose rendering is not currently
supported. Previously, unsupported types defaulted to being rendered as
line charts, which could lead to confusion. With this commit, we instead
display a message stating that the chart type is not supported, and do
not attempt to render it.

Note that at this time, the message is hard-coded only in English
language text. In the short term it should be internationalised, though
in the longer term, the intent is that all chart types will be properly
rendered.

Change-Id: I66eecb3368abaf228d80c21ab664a1eb2b45ae32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197128
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2026-02-12 16:11:54 +01:00
Kurt Nordback 2dba43e317 tdf#165742 Step 5.1: Support basic I/O for additional chartex types
Previous work on this project added support for Funnel charts, one of the
chartex types. This commit expands that to all the other chartex types,
including RegionMap. Largely this is parallel to what was done for Funnel,
but there are some namespace differences, and ParetoLine requires some special
handling because Microsoft Office seems to encode it as a combination of
clusteredColumn type and paretoLine type. ParetoLine support is incomplete,
especially on the export side.

Change-Id: Ib751632ec05f3fbf248e0f194f7a6f36f2fa6a88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194933
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2026-01-09 07:21:24 +01:00
Noel Grandin 1bd04a5413 [API CHANGE] remove XPivotTableDataProvider
in favor of a regular C++ interface class, since this is purely used internally to LO

Change-Id: I84991efb1b0c8829e2175dc083b0f8627fcb1712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194512
Code-Style: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-11-26 10:06:23 +01:00
Tomaž Vajngerl 58d2a68530 tdf#164593 Revert "tdf#82716 Add initial implementation of the His.."
This reverts commit 07ae0e5ada.

As discussed in https://lists.freedesktop.org/archives/libreoffice/2025-November/093988.html

(cherry picked from commit 9693f1461c7d78c7461f8bbd7f421ba8c3f8452b)

Change-Id: Ifd4008d62f9816d995f97104ba432ebc8be89c97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186407
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193983
2025-11-14 08:44:54 +01:00
Marco Cecchetti 8870c3feb8 chart color palette for data series: dialog tab pane
Change-Id: I0877212c715d320e954fcd8089d4f984eae16ac6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184265
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185143
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Jenkins
2025-05-20 11:37:24 +02:00
Marco Cecchetti e85be68352 chart color palette for data series: sidebar panel
Change-Id: I6f661515e2de11ea1ead0b79435413d6a0e81c9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184264
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185142
Tested-by: Jenkins
2025-05-13 14:29:46 +02:00
knordback abc8ea2da2 tdf#165742 Step 2: Create a ChartType derived class for chartex funnel chart.
This is a subtask of tdf#165742: Chartex charts are lost on input from OOXML and re-export.

Create ChartType and ChartTypeTemplate derived classes for funnel chart.

Change-Id: I6019412c59e0228bf37a893ced7617a4e3056add
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183461
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-04-17 11:01:09 +02:00
Noel Grandin b81f1bce73 fold ColorPerPointHelper into DataSeries
Where it better belongs, and where we can do a much better implementation.

Change-Id: I0ea8004778c3697bda97972cb842241459538c30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184065
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-04-11 21:46:25 +02:00
Noel Grandin 76d296f760 fold ChartModelHelper functions into ChartModel
This moves functions from ChartModelHelper to ChartModel
where it better belongs to. We can access the concrete classes now
instead of accessing through UNO si this is possible to do.

Change-Id: I21dce8aabe8f8a956863beef7ca5cb4ec6f3b44b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183990
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-04-11 07:07:23 +02:00
Noel Grandin 215500ea4d merge ExplicitValueProvider interface into ChartView
Change-Id: I4e5ef8c00b8e1b001d0f711c0c15814d316e2905
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183479
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-03-31 18:49:10 +02:00
Noel Grandin c976458eb2 simplify the DLL annotations in chart2
now that the libraries are merged, nothing needs to be visible

Change-Id: I009f062301ccec9cf9c57b3280a3cd7452adcf38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183482
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-31 07:50:55 +02:00
Noel Grandin e09f212f91 merge chartcore and chartcontroller libraries
there is no good reason to keep these separate

Change-Id: Ib484dbd5d331b0d1a117f5fc2e331123c4e70d82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183478
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-29 18:53:26 +01:00