Jump to content

Calligra/Chart Shape/Overall Design

From KDE Community Wiki
Revision as of 11:49, 8 December 2010 by Josim (talk | contribs) (moved Calligra/KChart/Overall Design to Calligra/Chart Shape/Overall Design: There's no KChart application anymore at this point, and it is very unlikely to be revived in the future. It is much more convenient for both the user and developer t)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

Classes

ChartShape

This is the KoShape implementation and thus the interface for KOffice's internals. Loading and saving starts here. Exactly one instance per chart.

PlotArea

Represents everything that belongs to the plot area, there's always exactly one instance of this class for one chart.

Axis

Owns the actual diagrams as the diagram's scaling depends on the axis. (If you think "WTF!?" here, see Calligra/KChart/Refactors)

ChartProxyModel

Represents the central source of data acting as a kind of proxy for all data tables.

TableSource

Manages all tables used by chart.

DataSet

Responsible for properties and data of a particular data set.

KDChartModel

Data interface for KD Chart. Combines a list of DataSets (with their properties and data) into a single model.

Legend

Stores properties of a legend, draws it, loads and saves it from/to ODF.

Integration of KD Chart

Everything, data and attributes, we offer to KD Chart through KDChartModel. The value for a specific data point it retrieves using Qt::DisplayRole. For attributes it uses a seperate data role, e.g. it retrieves the DataValueAttributes for a certain data point though KDChartModel::data(index, KDChart::DataValueLabelAttributesRole).

All attributes are communicated by this method. We do not use setter or getter for [DataValue/Pie/Bar/StockBar/Line]Attributes of any of the KDChart::AbstractDiagram subclasses.