A correlation circle plot reads the ends of its range differently from every
other chart type: the last two columns are the dimensions its points are placed
against and the columns before them are the features. One range holds the lot,
so nothing about the entry gives that away, and a reader who does not already
know it has no way to work it out.
Display a information label under the range input saying the last two
columns of it are component dimensions and the columns before that are
features.
Change-Id: Ib7d27aad189f12be188f61b1fc317dd1e718b803
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8105
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 2cbf62e18df956ed23c77932cd5e38424e7baa1f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210470
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
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>
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
A bin width much smaller than the data range asks for a bin count
with no upper bound. Over a range of 1000 a width of a millionth
resolves to a billion bins. The conversion from double to sal_Int32
had no range check either, so it could overflow.
Cap the count at MAX_HISTOGRAM_BINS. The division stays in double
and saturates at the cap, and a fixed count from a document is
clamped the same way.
A capped count no longer spans the range with the requested width,
so the range is divided evenly instead. Scott's rule gets the same
treatment when it yields no width at all.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ib59ee462edade94799cc58e503b843696743ecfe
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10257
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 93a9df897a14ec12457aa40d328616eb071a9175)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210337
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Histogram bin-property changes regenerated the category sequence stored
on the data series, while the X axis continued referencing the previous
sequence. This left the chart bars updated but displayed stale bin
labels.
Keep the category sequence produced by HistogramDataInterpreter on both
the diagram axis and data series. Update its binning parameters in place
when histogram properties change, allowing existing listeners to
recalculate and redraw the axis labels.
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: Ibd6679bddf29de5fa1fd903af9274259b2e9c243
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9282
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 0103afa2a6a746ce54a0e3e4297e1fa60698ef03)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209218
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
It appears that the ownerIdx attribute of <cx:series> is used to indicate
that series share data. At least that seems to be the case with pareto
charts, which have both a clustered column and a pareto line series. Going
on that assumption, implement parsing/export of ownerIdx, and don't write
a dataId tag when ownerIdx is present. That fixes round-tripping of
pareto charts, at least based on what I've seen.
Signed-off-by: Kurt Nordback <kurt.nordback@collabora.com>
Change-Id: Ie948d2e5992b778462e34e1ef90681631c867332
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5900
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 8c37a25ffb7711f69de978045b4e3dc8d52759da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209240
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Add model properties for optional underflow and overflow bins on
histogram chart types, and expose them through the HistogramDiagram
wrapper.
Pass the new settings through the existing histogram pipeline:
HistogramChartType snapshots the properties, HistogramDataSequence keeps
that snapshot, and HistogramCalculator creates optional edge bins around
the normal bin range.
Generated category labels now distinguish special bins from normal ranges,
e.g. "<= 11", "(11-13]", and "> 14".
Add a model-level test that sets fixed bin width together with underflow
and overflow bins, then verifies that the generated bin labels are rebuilt
correctly.
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: I65eac9607daa4f4be6320304c9e9682549f479a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207151
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
HistogramDataSequence snapshots the histogram binning
settings when the calculated-y and category sequences
are created. Rebuild those sequences when BinWidth,
BinCount, or FrequencyType changes, so fixed-bin settings
take effect immediately.
For XLSX import, use the regenerated histogram series
categories as the X axis categories. Keeping the existing
axis categories can preserve stale bin labels, e.g. after
reloading a chart exported with cx:binCount.
Extend the histogram roundtrip test to verify that fixed
bin count creates the expected bin labels after ODF
and XLSX reload.
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: I718bbfe537d847de6c17ea7742a9c4d231b57b7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207007
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
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>
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>
The gapWidth tag specifies spacing for bar/column-like charts. In old-style
charts, it's given in the type group. In chartex, it is an attribute of the
<cx:catScaling> child element of <cx:axis>. This code thus includes some
structural changes to allow for reading the value in the axis processing
and storing it in the PropertySet associated with a type group (XChartType).
Change-Id: I21bdf3b511269c34c225873ee66fbaf29a7cb0ea
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/718
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit bb1d3ba56f5b17d0979addac95a3973278d2f46b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204149
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Don't export a series shape properties (spPr) for chartex charts if none was
present on input. Also a basic test for this.
Change-Id: I1692e8dbd160fa7d0db6fd0d50ca1ba42a9e9fca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202633
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Add framework for import/export of chartex layout properties (cx:layoutPr).
Also support the child cx:binning property, used for clusteredColumn charts
(and perhaps others). This allows the binning property to round-trip
successfully MSO -> LO -> MSO.
Change-Id: I54bd1692ce4fb59dd70c9d4ac68f108c33cbca8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199553
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
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>
Support import, storage, and export of OOXML chart color styles
(color sequence). In OOXML, chart color styles are in files such
as colors1.xml, and conform to the chartStyle schema. This commit
supports I/O of color styles, and provides supports storing them
in the chart document model. It does not include any features for
using or modifying the color styles, so at this point it has no
appreciable effect on users.
Change-Id: I5c02137ebf9c25e11951eea55c4c77fda35b0e80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194998
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This adds ComplexColor to many of the color properties that are
available in charts. It also handles some import code in oox, so
the complex colors are set correctly to the chart elements if an
OOXML document is loaded. This doesn't yet handle export and if
a theme is changed, as well if a color is changed manually in
the chart.
Change the tests so they now assert the scheme color like it is
defined in the source document and not the calculated derived
color.
In addition change the WriteRunProperties to have a struct as
an input instead a number of parameters, which in most cases don't
need to be filled out and are using the default value.
This was needed for the new parameter bUseTextSchemeColors, which
is used for charts, so the text colors use tx1 and tx2 elements
instead dk1 and dk2, which are usually used in Impress.
Change-Id: Iaebbaea983c5232c51233c1a02bd8fe1da24d551
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194939
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Since aOldBroadcasters is empty at this point, assign() is efficient than insert(). This is a cleanup following the already merged patch.
Change-Id: I8315a5c8021a67f003f84f3002a13c1511dc04c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192744
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Whatever that was intended to mean: if that meant that the constants
were encoded that way, these are UTF-16 already; is that meant that
they only contained characters in that range, that is unimportant.
Change-Id: I5463f1fca0d552a93d3c9d487ed9912c9e1a989e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191240
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Parse the style*.xml file in the OOXML package, and store the imported
styles in XChartDocument via a new XChartStyle. Some areas are yet to be
fleshed out, but the intent here is to get a review of the general approach
and architecture. This includes no work on the export side (or the UI and
application of styles to a chart, which is a separate but related project).
Change-Id: I9d5b9f5aa44fb7944b2d971edc26e04dc2256c7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189531
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>