Changeset View
Changeset View
Standalone View
Standalone View
filters/libodf2/chart/Charting.h
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Line(s) | 213 | public: | |||
---|---|---|---|---|---|
214 | /// Starting angle of the first data point clockwise from the top of the circle. | 214 | /// Starting angle of the first data point clockwise from the top of the circle. | ||
215 | int m_anStart; | 215 | int m_anStart; | ||
216 | 216 | | |||
217 | explicit PieImpl(int anStart = 0) | 217 | explicit PieImpl(int anStart = 0) | ||
218 | : ChartImpl() | 218 | : ChartImpl() | ||
219 | , m_anStart(anStart) | 219 | , m_anStart(anStart) | ||
220 | {} | 220 | {} | ||
221 | 221 | | |||
222 | virtual QByteArray name() const { return "circle"; } | 222 | QByteArray name() const override { return "circle"; } | ||
223 | }; | 223 | }; | ||
224 | 224 | | |||
225 | class RingImpl : public PieImpl | 225 | class RingImpl : public PieImpl | ||
226 | { | 226 | { | ||
227 | public: | 227 | public: | ||
228 | /// Size of the center hole in a doughnut chart group as a percentage of the plot area size. | 228 | /// Size of the center hole in a doughnut chart group as a percentage of the plot area size. | ||
229 | int m_pcDonut; | 229 | int m_pcDonut; | ||
230 | 230 | | |||
231 | explicit RingImpl(int anStart = 0, int pcDonut = 0) | 231 | explicit RingImpl(int anStart = 0, int pcDonut = 0) | ||
232 | : PieImpl(anStart) | 232 | : PieImpl(anStart) | ||
233 | , m_pcDonut(pcDonut) | 233 | , m_pcDonut(pcDonut) | ||
234 | {} | 234 | {} | ||
235 | 235 | | |||
236 | virtual QByteArray name() const { return "ring"; } | 236 | QByteArray name() const override { return "ring"; } | ||
237 | }; | 237 | }; | ||
238 | 238 | | |||
239 | class BarImpl : public ChartImpl | 239 | class BarImpl : public ChartImpl | ||
240 | { | 240 | { | ||
241 | public: | 241 | public: | ||
242 | virtual QByteArray name() const { return "bar"; } | 242 | QByteArray name() const override { return "bar"; } | ||
243 | }; | 243 | }; | ||
244 | 244 | | |||
245 | class LineImpl : public ChartImpl | 245 | class LineImpl : public ChartImpl | ||
246 | { | 246 | { | ||
247 | public: | 247 | public: | ||
248 | virtual QByteArray name() const { return "line"; } | 248 | QByteArray name() const override { return "line"; } | ||
249 | }; | 249 | }; | ||
250 | 250 | | |||
251 | class RadarImpl : public ChartImpl | 251 | class RadarImpl : public ChartImpl | ||
252 | { | 252 | { | ||
253 | public: | 253 | public: | ||
254 | /// If true then the radar-chart is filled (a RadarArea chart), else not. | 254 | /// If true then the radar-chart is filled (a RadarArea chart), else not. | ||
255 | bool m_filled; | 255 | bool m_filled; | ||
256 | 256 | | |||
257 | explicit RadarImpl(bool filled = false) | 257 | explicit RadarImpl(bool filled = false) | ||
258 | : ChartImpl() | 258 | : ChartImpl() | ||
259 | , m_filled(filled) | 259 | , m_filled(filled) | ||
260 | {} | 260 | {} | ||
261 | 261 | | |||
262 | virtual QByteArray name() const { return m_filled ? "filled-radar" : "radar"; } | 262 | QByteArray name() const override { return m_filled ? "filled-radar" : "radar"; } | ||
263 | }; | 263 | }; | ||
264 | 264 | | |||
265 | class AreaImpl : public ChartImpl | 265 | class AreaImpl : public ChartImpl | ||
266 | { | 266 | { | ||
267 | public: | 267 | public: | ||
268 | AreaImpl() : ChartImpl() {} | 268 | AreaImpl() : ChartImpl() {} | ||
269 | 269 | | |||
270 | virtual QByteArray name() const { return "area"; } | 270 | QByteArray name() const override { return "area"; } | ||
271 | }; | 271 | }; | ||
272 | 272 | | |||
273 | class StockImpl : public ChartImpl | 273 | class StockImpl : public ChartImpl | ||
274 | { | 274 | { | ||
275 | public: | 275 | public: | ||
276 | StockImpl() : ChartImpl() {} | 276 | StockImpl() : ChartImpl() {} | ||
277 | 277 | | |||
278 | virtual QByteArray name() const { return "stock"; } | 278 | QByteArray name() const override { return "stock"; } | ||
279 | }; | 279 | }; | ||
280 | 280 | | |||
281 | class ScatterImpl : public ChartImpl | 281 | class ScatterImpl : public ChartImpl | ||
282 | { | 282 | { | ||
283 | public: | 283 | public: | ||
284 | enum ScatterStyle { None, Line, LineMarker, Marker, Smooth, SmoothMarker }; | 284 | enum ScatterStyle { None, Line, LineMarker, Marker, Smooth, SmoothMarker }; | ||
285 | ScatterStyle style; | 285 | ScatterStyle style; | ||
286 | 286 | | |||
287 | ScatterImpl() | 287 | ScatterImpl() | ||
288 | : ChartImpl() | 288 | : ChartImpl() | ||
289 | , style(LineMarker) | 289 | , style(LineMarker) | ||
290 | {} | 290 | {} | ||
291 | 291 | | |||
292 | virtual QByteArray name() const { return "scatter"; } | 292 | QByteArray name() const override { return "scatter"; } | ||
293 | }; | 293 | }; | ||
294 | 294 | | |||
295 | class BubbleImpl : public ChartImpl | 295 | class BubbleImpl : public ChartImpl | ||
296 | { | 296 | { | ||
297 | public: | 297 | public: | ||
298 | enum SizeType { | 298 | enum SizeType { | ||
299 | Area = 0x0001, ///< The area of the data point represents the value. | 299 | Area = 0x0001, ///< The area of the data point represents the value. | ||
300 | Width = 0x0002 ///< The width of the data point represents the value. | 300 | Width = 0x0002 ///< The width of the data point represents the value. | ||
Show All 12 Lines | |||||
313 | explicit BubbleImpl(SizeType sizeType = Area, unsigned int sizeRatio = 100, | 313 | explicit BubbleImpl(SizeType sizeType = Area, unsigned int sizeRatio = 100, | ||
314 | bool showNegativeBubbles = true) | 314 | bool showNegativeBubbles = true) | ||
315 | : ChartImpl() | 315 | : ChartImpl() | ||
316 | , m_sizeType(sizeType) | 316 | , m_sizeType(sizeType) | ||
317 | , m_sizeRatio(sizeRatio) | 317 | , m_sizeRatio(sizeRatio) | ||
318 | , m_showNegativeBubbles(showNegativeBubbles) | 318 | , m_showNegativeBubbles(showNegativeBubbles) | ||
319 | {} | 319 | {} | ||
320 | 320 | | |||
321 | virtual QByteArray name() const { return "bubble"; } | 321 | QByteArray name() const override { return "bubble"; } | ||
322 | }; | 322 | }; | ||
323 | 323 | | |||
324 | class SurfaceImpl : public ChartImpl | 324 | class SurfaceImpl : public ChartImpl | ||
325 | { | 325 | { | ||
326 | public: | 326 | public: | ||
327 | /// Specifies that the surface is either filled or a wireframe. | 327 | /// Specifies that the surface is either filled or a wireframe. | ||
328 | bool m_fill; | 328 | bool m_fill; | ||
329 | 329 | | |||
330 | explicit SurfaceImpl(bool fill = false) : ChartImpl(), m_fill(fill) {} | 330 | explicit SurfaceImpl(bool fill = false) : ChartImpl(), m_fill(fill) {} | ||
331 | 331 | | |||
332 | virtual QByteArray name() const { return "surface"; } | 332 | QByteArray name() const override { return "surface"; } | ||
333 | }; | 333 | }; | ||
334 | 334 | | |||
335 | 335 | | |||
336 | // ---------------------------------------------------------------- | 336 | // ---------------------------------------------------------------- | ||
337 | // Objects within the chart | 337 | // Objects within the chart | ||
338 | 338 | | |||
339 | 339 | | |||
340 | class Obj | 340 | class Obj | ||
Show All 23 Lines | |||||
364 | { | 364 | { | ||
365 | public: | 365 | public: | ||
366 | QString m_text; | 366 | QString m_text; | ||
367 | 367 | | |||
368 | explicit Text(const QString &text = QString()) | 368 | explicit Text(const QString &text = QString()) | ||
369 | : Obj() | 369 | : Obj() | ||
370 | , m_text(text) | 370 | , m_text(text) | ||
371 | {} | 371 | {} | ||
372 | virtual ~Text() {} | 372 | ~Text() override {} | ||
373 | }; | 373 | }; | ||
374 | 374 | | |||
375 | class Axis : public Obj | 375 | class Axis : public Obj | ||
376 | { | 376 | { | ||
377 | public: | 377 | public: | ||
378 | enum Type { | 378 | enum Type { | ||
379 | HorizontalValueAxis = 0x0000, | 379 | HorizontalValueAxis = 0x0000, | ||
380 | VerticalValueAxis = 0x0001, | 380 | VerticalValueAxis = 0x0001, | ||
Show All 30 Lines | |||||
411 | , m_type(type) | 411 | , m_type(type) | ||
412 | , m_reversed(false) | 412 | , m_reversed(false) | ||
413 | , m_logarithmic(false) | 413 | , m_logarithmic(false) | ||
414 | , m_autoMinimum(true) | 414 | , m_autoMinimum(true) | ||
415 | , m_autoMaximum(true) | 415 | , m_autoMaximum(true) | ||
416 | , m_minimum(0) | 416 | , m_minimum(0) | ||
417 | , m_maximum(0) | 417 | , m_maximum(0) | ||
418 | {} | 418 | {} | ||
419 | virtual ~Axis() {} | 419 | ~Axis() override {} | ||
420 | }; | 420 | }; | ||
421 | 421 | | |||
422 | class Cell | 422 | class Cell | ||
423 | { | 423 | { | ||
424 | public: | 424 | public: | ||
425 | int m_column; | 425 | int m_column; | ||
426 | int m_row; | 426 | int m_row; | ||
427 | QString m_value; | 427 | QString m_value; | ||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | 507 | public: | |||
567 | , m_countBubbleSizeValues(0) | 567 | , m_countBubbleSizeValues(0) | ||
568 | , m_showDataLabelValues(false) | 568 | , m_showDataLabelValues(false) | ||
569 | , m_showDataLabelPercent(false) | 569 | , m_showDataLabelPercent(false) | ||
570 | , m_showDataLabelCategory(false) | 570 | , m_showDataLabelCategory(false) | ||
571 | , m_showDataLabelSeries(false) | 571 | , m_showDataLabelSeries(false) | ||
572 | , m_markerType(NoMarker) | 572 | , m_markerType(NoMarker) | ||
573 | ,spPr(0) | 573 | ,spPr(0) | ||
574 | {} | 574 | {} | ||
575 | virtual ~Series() | 575 | ~Series() override | ||
576 | { | 576 | { | ||
577 | qDeleteAll(m_datasetValue); | 577 | qDeleteAll(m_datasetValue); | ||
578 | qDeleteAll(m_dataPoints); | 578 | qDeleteAll(m_dataPoints); | ||
579 | qDeleteAll(m_datasetFormat); | 579 | qDeleteAll(m_datasetFormat); | ||
580 | 580 | | |||
581 | delete spPr; | 581 | delete spPr; | ||
582 | } | 582 | } | ||
583 | }; | 583 | }; | ||
584 | 584 | | |||
585 | class PlotArea : public Obj | 585 | class PlotArea : public Obj | ||
586 | { | 586 | { | ||
587 | public: | 587 | public: | ||
588 | explicit PlotArea() | 588 | explicit PlotArea() | ||
589 | : Obj() | 589 | : Obj() | ||
590 | {} | 590 | {} | ||
591 | virtual ~PlotArea() {} | 591 | ~PlotArea() override {} | ||
592 | }; | 592 | }; | ||
593 | 593 | | |||
594 | class Legend : public Obj | 594 | class Legend : public Obj | ||
595 | { | 595 | { | ||
596 | public: | 596 | public: | ||
597 | explicit Legend() : Obj() {} | 597 | explicit Legend() : Obj() {} | ||
598 | virtual ~Legend() {} | 598 | ~Legend() override {} | ||
599 | }; | 599 | }; | ||
600 | 600 | | |||
601 | /// The main charting class that represents a single chart. | 601 | /// The main charting class that represents a single chart. | ||
602 | class Chart : public Obj | 602 | class Chart : public Obj | ||
603 | { | 603 | { | ||
604 | public: | 604 | public: | ||
605 | QString m_sheetName; | 605 | QString m_sheetName; | ||
606 | 606 | | |||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
685 | , m_fillGradient(0) | 685 | , m_fillGradient(0) | ||
686 | , m_plotAreaFillGradient(0) | 686 | , m_plotAreaFillGradient(0) | ||
687 | , m_markerType(NoMarker) | 687 | , m_markerType(NoMarker) | ||
688 | , m_showLines(false) | 688 | , m_showLines(false) | ||
689 | , m_textSize(10) | 689 | , m_textSize(10) | ||
690 | { | 690 | { | ||
691 | m_x1 = m_y1 = m_x2 = m_y2 = -1; // -1 means autoposition/autosize | 691 | m_x1 = m_y1 = m_x2 = m_y2 = -1; // -1 means autoposition/autosize | ||
692 | } | 692 | } | ||
693 | virtual ~Chart() | 693 | ~Chart() override | ||
694 | { | 694 | { | ||
695 | qDeleteAll(m_series); | 695 | qDeleteAll(m_series); | ||
696 | qDeleteAll(m_texts); | 696 | qDeleteAll(m_texts); | ||
697 | delete m_impl; | 697 | delete m_impl; | ||
698 | delete m_plotArea; | 698 | delete m_plotArea; | ||
699 | delete m_legend; | 699 | delete m_legend; | ||
700 | delete m_fillGradient; | 700 | delete m_fillGradient; | ||
701 | delete m_plotAreaFillGradient; | 701 | delete m_plotAreaFillGradient; | ||
Show All 24 Lines |