├── .gitignore
├── .gitlab-ci.yml
├── .kde-ci.yml
├── CMakeLists.txt
├── CMakePresets.json
├── LICENSE.GPL.txt
├── LICENSES
├── GPL-2.0-or-later.txt
└── LGPL-2.0-or-later.txt
├── Mainpage.dox
├── examples
├── Axis
│ ├── CMakeLists.txt
│ ├── Chart
│ │ ├── BarChart.qrc
│ │ ├── CMakeLists.txt
│ │ ├── barSimple.csv
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── Labels
│ │ ├── AdjustedCartesianAxis.cpp
│ │ ├── AdjustedCartesianAxis.h
│ │ ├── BarChart.qrc
│ │ ├── CMakeLists.txt
│ │ ├── barSimple.csv
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── Parameters
│ │ ├── Axes.qrc
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ └── Widget
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── Background
│ ├── CMakeLists.txt
│ ├── background.png
│ └── main.cpp
├── Bars
│ ├── Advanced
│ │ ├── BarChart.qrc
│ │ ├── CMakeLists.txt
│ │ ├── barSimple.csv
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── Parameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── CMakeLists.txt
├── DataValueTexts
│ ├── CMakeLists.txt
│ ├── DataValueTexts.qrc
│ ├── barPositiveNegative.csv
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ └── mainwindow.ui
├── DrawIntoPainter
│ ├── CMakeLists.txt
│ ├── DrawIntoPainter.qrc
│ ├── framewidget.cpp
│ ├── framewidget.h
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ └── mainwindow.ui
├── EmptyValues
│ ├── BarChart.qrc
│ ├── CMakeLists.txt
│ ├── barSimple.csv
│ ├── main.cpp
│ ├── mainwindow.cpp
│ └── mainwindow.h
├── Gantt
│ ├── CMakeLists.txt
│ ├── common
│ │ ├── projectmodel.cpp
│ │ └── projectmodel.h
│ ├── legend_example
│ │ ├── CMakeLists.txt
│ │ ├── entrydelegate.cpp
│ │ ├── entrydelegate.h
│ │ ├── entrydialog.cpp
│ │ ├── entrydialog.h
│ │ ├── entrydialog.ui
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── palette
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ └── mainwindow.h
│ ├── printing
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ └── mainwindow.h
│ └── project
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ └── mainwindow.h
├── Grids
│ ├── CMakeLists.txt
│ ├── CartesianGrid
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── PolarGrid
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
├── HeadersFooters
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── HeadersFooters.qrc
│ │ ├── addheaderdialog.ui
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── HeadersFootersParameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── HeadersFootersSimple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── Legends
│ ├── CMakeLists.txt
│ ├── LegendAdvanced
│ │ ├── CMakeLists.txt
│ │ ├── Legends.qrc
│ │ ├── addlegenddialog.ui
│ │ ├── derivedaddlegenddialog.cpp
│ │ ├── derivedaddlegenddialog.h
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── LegendOverDiagram
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── LegendParameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── LegendSimple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── LeveyJennings
│ ├── CMakeLists.txt
│ └── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── Lines
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── LineChart.qrc
│ │ ├── lineAnimate.csv
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── AreaPerCell
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── CMakeLists.txt
│ ├── Parameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── PointChart
│ │ ├── CMakeLists.txt
│ │ ├── LineChart.qrc
│ │ ├── line.csv
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── PointWidget
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── SimpleLineWidget
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── ModelView
│ ├── CMakeLists.txt
│ ├── HidingData
│ │ ├── CMakeLists.txt
│ │ ├── ModelView.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ ├── mainwindow.ui
│ │ └── qtdata.cht
│ └── TableView
│ │ ├── CMakeLists.txt
│ │ ├── ModelView.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── qtdata.cht
├── NoValues
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── mainwindow.cpp
│ └── mainwindow.h
├── Pie
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── Pie.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── Parameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── Plane
│ ├── AdjustedBoundaries
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── CMakeLists.txt
│ └── OverlayedPlanes
│ │ ├── CMakeLists.txt
│ │ ├── OverlayedPlanes.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
├── Plotter
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── BigDataset
│ │ ├── CMakeLists.txt
│ │ ├── Controls.ui
│ │ ├── MainWidget.cpp
│ │ ├── MainWidget.h
│ │ ├── Model.cpp
│ │ ├── Model.h
│ │ └── main.cpp
│ ├── BubbleChart
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── Isometric
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── Logarithmic
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ ├── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── Timeline
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── timeaxis.cpp
│ │ ├── timeaxis.h
│ │ ├── timechartmodel.cpp
│ │ └── timechartmodel.h
├── Polar
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── Parameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── README.txt
├── RealTime
│ ├── CMakeLists.txt
│ └── main.cpp
├── SharedAbscissa
│ ├── CMakeLists.txt
│ └── SeparateDiagrams
│ │ ├── CMakeLists.txt
│ │ ├── SharedAbscissa.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
├── Sql
│ ├── CMakeLists.txt
│ └── main.cpp
├── Stock
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── HLC.csv
│ │ ├── OHLC.csv
│ │ ├── Resources.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ └── CMakeLists.txt
├── TernaryCharts
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ └── CMakeLists.txt
├── Widget
│ ├── Advanced
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
│ ├── CMakeLists.txt
│ ├── Parameters
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
│ └── Simple
│ │ ├── CMakeLists.txt
│ │ └── main.cpp
├── Zoom
│ ├── CMakeLists.txt
│ ├── Keyboard
│ │ ├── CMakeLists.txt
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ ├── mainwindow.ui
│ │ ├── zoomwidget.cpp
│ │ └── zoomwidget.h
│ └── ScrollBars
│ │ ├── CMakeLists.txt
│ │ ├── ZoomScrollBars.qrc
│ │ ├── main.cpp
│ │ ├── mainwindow.cpp
│ │ ├── mainwindow.h
│ │ └── mainwindow.ui
├── demo
│ ├── CMakeLists.txt
│ ├── KChart-Test-Pie.csv
│ ├── axissettings.cpp
│ ├── axissettings.h
│ ├── axissettings.ui
│ ├── barSimple.csv
│ ├── colorslider.cpp
│ ├── colorslider.h
│ ├── datasetsettings.cpp
│ ├── datasetsettings.h
│ ├── datasetsettings.ui
│ ├── datavaluesettings.cpp
│ ├── datavaluesettings.h
│ ├── datavaluesettings.ui
│ ├── demo.qrc
│ ├── diagramsettings.cpp
│ ├── diagramsettings.h
│ ├── diagramsettings.ui
│ ├── diagramtypedialog.cpp
│ ├── diagramtypedialog.h
│ ├── diagramtypedialog.ui
│ ├── gradientdialog.cpp
│ ├── gradientdialog.h
│ ├── gradientdialog.ui
│ ├── lineAnimate.csv
│ ├── main.cpp
│ ├── mainwindow.cpp
│ └── mainwindow.h
├── table-of-contents.txt
└── tools
│ ├── CMakeLists.txt
│ ├── TableModel.cpp
│ ├── TableModel.h
│ └── modeldata
│ ├── KChart-Test-Cellnames.csv
│ ├── KChart-Test-Datatables.csv
│ ├── KChart-Test-Empty.csv
│ ├── KChart-Test-Linear.csv
│ ├── KChart-Test-Linear_1_dataset.csv
│ ├── KChart-Test-Pie.csv
│ ├── KChart-Test_Linear_One_Column.csv
│ └── KChart-Test_Linear_Two_Columns.csv
├── images
├── polar-plane-start-position.png
└── position-alignments.png
├── poqm
├── ar
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ast
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── bg
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── bs
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ca
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ca@valencia
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── cs
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── da
│ └── kgantt6_qt.po
├── de
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── el
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── en_GB
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── eo
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── es
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── et
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── eu
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── fi
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── fr
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── gl
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── he
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── hi
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ia
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── it
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ja
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ka
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ko
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── lt
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── lv
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── nl
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── nn
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── pl
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── pt
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── pt_BR
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── ro
│ └── kchart6_qt.po
├── ru
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── sa
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── sk
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── sl
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── sv
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── tr
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── uk
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── zh_CN
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
└── zh_TW
│ ├── kchart6_qt.po
│ └── kgantt6_qt.po
├── qtests
├── AttributesModel
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── AxisOwnership
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── BarDiagrams
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── CMakeLists.txt
├── CartesianDiagramDataCompressor
│ ├── CMakeLists.txt
│ └── CartesianDiagramDataCompressorTests.cpp
├── CartesianPlanes
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── ChartElementOwnership
│ ├── CMakeLists.txt
│ └── main.cpp
├── Cloning
│ ├── CMakeLists.txt
│ └── main.cpp
├── DrawIntoPainter
│ ├── CMakeLists.txt
│ ├── DrawIntoPainter.qrc
│ ├── data_empty.csv
│ ├── data_test.csv
│ ├── data_test_small.csv
│ ├── framewidget.cpp
│ ├── framewidget.h
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ └── mainwindow.ui
├── Legends
│ ├── CMakeLists.txt
│ └── main.cpp
├── LineDiagrams
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── Measure
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── Palette
│ ├── CMakeLists.txt
│ └── main.cpp
├── ParamVsParam
│ ├── CMakeLists.txt
│ ├── ModelParamVsParam.cpp
│ ├── ModelParamVsParam.h
│ ├── ModelParamVsParamPlot.cpp
│ ├── ModelParamVsParamPlot.h
│ ├── main.cpp
│ ├── mainwindow.cpp
│ └── mainwindow.h
├── PieDiagrams
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── PolarDiagrams
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── PolarPlanes
│ ├── CMakeLists.txt
│ ├── Data.qrc
│ └── main.cpp
├── QLayout
│ ├── CMakeLists.txt
│ └── main.cpp
├── RelativePosition
│ ├── CMakeLists.txt
│ └── main.cpp
└── WidgetElementOwnership
│ ├── CMakeLists.txt
│ └── main.cpp
├── src
├── CMakeLists.txt
├── KChart
│ ├── CMakeLists.txt
│ ├── Cartesian
│ │ ├── CartesianCoordinateTransformation.h
│ │ ├── DiagramFlavors
│ │ │ ├── KChartNormalBarDiagram_p.cpp
│ │ │ ├── KChartNormalBarDiagram_p.h
│ │ │ ├── KChartNormalLineDiagram_p.cpp
│ │ │ ├── KChartNormalLineDiagram_p.h
│ │ │ ├── KChartNormalLyingBarDiagram_p.cpp
│ │ │ ├── KChartNormalLyingBarDiagram_p.h
│ │ │ ├── KChartNormalPlotter_p.cpp
│ │ │ ├── KChartNormalPlotter_p.h
│ │ │ ├── KChartPercentBarDiagram_p.cpp
│ │ │ ├── KChartPercentBarDiagram_p.h
│ │ │ ├── KChartPercentLineDiagram_p.cpp
│ │ │ ├── KChartPercentLineDiagram_p.h
│ │ │ ├── KChartPercentLyingBarDiagram_p.cpp
│ │ │ ├── KChartPercentLyingBarDiagram_p.h
│ │ │ ├── KChartPercentPlotter_p.cpp
│ │ │ ├── KChartPercentPlotter_p.h
│ │ │ ├── KChartStackedBarDiagram_p.cpp
│ │ │ ├── KChartStackedBarDiagram_p.h
│ │ │ ├── KChartStackedLineDiagram_p.cpp
│ │ │ ├── KChartStackedLineDiagram_p.h
│ │ │ ├── KChartStackedLyingBarDiagram_p.cpp
│ │ │ ├── KChartStackedLyingBarDiagram_p.h
│ │ │ ├── KChartStackedPlotter_p.cpp
│ │ │ └── KChartStackedPlotter_p.h
│ │ ├── KChartAbstractCartesianDiagram.cpp
│ │ ├── KChartAbstractCartesianDiagram.h
│ │ ├── KChartAbstractCartesianDiagram_p.h
│ │ ├── KChartBarAttributes.cpp
│ │ ├── KChartBarAttributes.h
│ │ ├── KChartBarDiagram.cpp
│ │ ├── KChartBarDiagram.h
│ │ ├── KChartBarDiagram_p.cpp
│ │ ├── KChartBarDiagram_p.h
│ │ ├── KChartCartesianAxis.cpp
│ │ ├── KChartCartesianAxis.h
│ │ ├── KChartCartesianAxis_p.h
│ │ ├── KChartCartesianCoordinatePlane.cpp
│ │ ├── KChartCartesianCoordinatePlane.h
│ │ ├── KChartCartesianCoordinatePlane_p.h
│ │ ├── KChartCartesianDiagramDataCompressor_p.cpp
│ │ ├── KChartCartesianDiagramDataCompressor_p.h
│ │ ├── KChartCartesianGrid.cpp
│ │ ├── KChartCartesianGrid.h
│ │ ├── KChartLeveyJenningsAxis.cpp
│ │ ├── KChartLeveyJenningsAxis.h
│ │ ├── KChartLeveyJenningsAxis_p.h
│ │ ├── KChartLeveyJenningsCoordinatePlane.cpp
│ │ ├── KChartLeveyJenningsCoordinatePlane.h
│ │ ├── KChartLeveyJenningsCoordinatePlane_p.h
│ │ ├── KChartLeveyJenningsDiagram.cpp
│ │ ├── KChartLeveyJenningsDiagram.h
│ │ ├── KChartLeveyJenningsDiagram_p.cpp
│ │ ├── KChartLeveyJenningsDiagram_p.h
│ │ ├── KChartLeveyJenningsGrid.cpp
│ │ ├── KChartLeveyJenningsGrid.h
│ │ ├── KChartLeveyJenningsGridAttributes.cpp
│ │ ├── KChartLeveyJenningsGridAttributes.h
│ │ ├── KChartLineDiagram.cpp
│ │ ├── KChartLineDiagram.h
│ │ ├── KChartLineDiagram_p.cpp
│ │ ├── KChartLineDiagram_p.h
│ │ ├── KChartPlotter.cpp
│ │ ├── KChartPlotter.h
│ │ ├── KChartPlotterDiagramCompressor.cpp
│ │ ├── KChartPlotterDiagramCompressor.h
│ │ ├── KChartPlotterDiagramCompressor_p.h
│ │ ├── KChartPlotter_p.cpp
│ │ ├── KChartPlotter_p.h
│ │ ├── KChartStockBarAttributes.cpp
│ │ ├── KChartStockBarAttributes.h
│ │ ├── KChartStockDiagram.cpp
│ │ ├── KChartStockDiagram.h
│ │ ├── KChartStockDiagram_p.cpp
│ │ ├── KChartStockDiagram_p.h
│ │ ├── KChartThreeDBarAttributes.cpp
│ │ ├── KChartThreeDBarAttributes.h
│ │ ├── KChartThreeDBarAttributes_p.h
│ │ ├── PaintingHelpers_p.cpp
│ │ └── PaintingHelpers_p.h
│ ├── ChartGraphicsItem.cpp
│ ├── ChartGraphicsItem.h
│ ├── KChart6Config.cmake.in
│ ├── KChartAbstractArea.cpp
│ ├── KChartAbstractArea.h
│ ├── KChartAbstractAreaBase.cpp
│ ├── KChartAbstractAreaBase.h
│ ├── KChartAbstractAreaBase_p.h
│ ├── KChartAbstractAreaWidget.cpp
│ ├── KChartAbstractAreaWidget.h
│ ├── KChartAbstractAreaWidget_p.h
│ ├── KChartAbstractArea_p.h
│ ├── KChartAbstractAxis.cpp
│ ├── KChartAbstractAxis.h
│ ├── KChartAbstractAxis_p.h
│ ├── KChartAbstractCoordinatePlane.cpp
│ ├── KChartAbstractCoordinatePlane.h
│ ├── KChartAbstractCoordinatePlane_p.h
│ ├── KChartAbstractDiagram.cpp
│ ├── KChartAbstractDiagram.h
│ ├── KChartAbstractDiagram_p.cpp
│ ├── KChartAbstractDiagram_p.h
│ ├── KChartAbstractGrid.cpp
│ ├── KChartAbstractGrid.h
│ ├── KChartAbstractProxyModel.cpp
│ ├── KChartAbstractProxyModel.h
│ ├── KChartAbstractThreeDAttributes.cpp
│ ├── KChartAbstractThreeDAttributes.h
│ ├── KChartAbstractThreeDAttributes_p.h
│ ├── KChartAttributesModel.cpp
│ ├── KChartAttributesModel.h
│ ├── KChartBackgroundAttributes.cpp
│ ├── KChartBackgroundAttributes.h
│ ├── KChartChart.cpp
│ ├── KChartChart.h
│ ├── KChartChart_p.h
│ ├── KChartDataValueAttributes.cpp
│ ├── KChartDataValueAttributes.h
│ ├── KChartDatasetProxyModel.cpp
│ ├── KChartDatasetProxyModel.h
│ ├── KChartDatasetSelector.cpp
│ ├── KChartDatasetSelector.h
│ ├── KChartDatasetSelector.ui
│ ├── KChartDiagramObserver.cpp
│ ├── KChartDiagramObserver.h
│ ├── KChartEnums.h
│ ├── KChartFrameAttributes.cpp
│ ├── KChartFrameAttributes.h
│ ├── KChartGlobal.h
│ ├── KChartGridAttributes.cpp
│ ├── KChartGridAttributes.h
│ ├── KChartHeaderFooter.cpp
│ ├── KChartHeaderFooter.h
│ ├── KChartHeaderFooter_p.h
│ ├── KChartLayoutItems.cpp
│ ├── KChartLayoutItems.h
│ ├── KChartLegend.cpp
│ ├── KChartLegend.h
│ ├── KChartLegend_p.h
│ ├── KChartLineAttributes.cpp
│ ├── KChartLineAttributes.h
│ ├── KChartMarkerAttributes.cpp
│ ├── KChartMarkerAttributes.h
│ ├── KChartMath_p.h
│ ├── KChartMeasure.cpp
│ ├── KChartMeasure.h
│ ├── KChartModelDataCache_p.cpp
│ ├── KChartModelDataCache_p.h
│ ├── KChartNullPaintDevice.h
│ ├── KChartPaintContext.cpp
│ ├── KChartPaintContext.h
│ ├── KChartPainterSaver_p.h
│ ├── KChartPalette.cpp
│ ├── KChartPalette.h
│ ├── KChartPosition.cpp
│ ├── KChartPosition.h
│ ├── KChartPrintingParameters.cpp
│ ├── KChartPrintingParameters.h
│ ├── KChartRelativePosition.cpp
│ ├── KChartRelativePosition.h
│ ├── KChartRulerAttributes.cpp
│ ├── KChartRulerAttributes.h
│ ├── KChartTextArea.cpp
│ ├── KChartTextArea.h
│ ├── KChartTextArea_p.h
│ ├── KChartTextAttributes.cpp
│ ├── KChartTextAttributes.h
│ ├── KChartTextLabelCache.cpp
│ ├── KChartTextLabelCache.h
│ ├── KChartThreeDLineAttributes.cpp
│ ├── KChartThreeDLineAttributes.h
│ ├── KChartThreeDLineAttributes_p.h
│ ├── KChartValueTrackerAttributes.cpp
│ ├── KChartValueTrackerAttributes.h
│ ├── KChartWidget.cpp
│ ├── KChartWidget.h
│ ├── KChartWidget_p.h
│ ├── KChartZoomParameters.h
│ ├── KChart_LeveyJennings_resources.qrc
│ ├── KTextDocument.cpp
│ ├── KTextDocument.h
│ ├── Mainpage.dox
│ ├── Messages.sh
│ ├── Polar
│ │ ├── KChartAbstractPieDiagram.cpp
│ │ ├── KChartAbstractPieDiagram.h
│ │ ├── KChartAbstractPieDiagram_p.h
│ │ ├── KChartAbstractPolarDiagram.cpp
│ │ ├── KChartAbstractPolarDiagram.h
│ │ ├── KChartAbstractPolarDiagram_p.h
│ │ ├── KChartPieAttributes.cpp
│ │ ├── KChartPieAttributes.h
│ │ ├── KChartPieAttributes_p.h
│ │ ├── KChartPieDiagram.cpp
│ │ ├── KChartPieDiagram.h
│ │ ├── KChartPieDiagram_p.h
│ │ ├── KChartPolarCoordinatePlane.cpp
│ │ ├── KChartPolarCoordinatePlane.h
│ │ ├── KChartPolarCoordinatePlane_p.h
│ │ ├── KChartPolarDiagram.cpp
│ │ ├── KChartPolarDiagram.h
│ │ ├── KChartPolarDiagram_p.h
│ │ ├── KChartPolarGrid.cpp
│ │ ├── KChartPolarGrid.h
│ │ ├── KChartRadarCoordinatePlane.cpp
│ │ ├── KChartRadarCoordinatePlane.h
│ │ ├── KChartRadarCoordinatePlane_p.h
│ │ ├── KChartRadarDiagram.cpp
│ │ ├── KChartRadarDiagram.h
│ │ ├── KChartRadarDiagram_p.h
│ │ ├── KChartRadarGrid.cpp
│ │ ├── KChartRadarGrid.h
│ │ ├── KChartRingDiagram.cpp
│ │ ├── KChartRingDiagram.h
│ │ ├── KChartRingDiagram_p.h
│ │ ├── KChartThreeDPieAttributes.cpp
│ │ ├── KChartThreeDPieAttributes.h
│ │ └── KChartThreeDPieAttributes_p.h
│ ├── ReverseMapper.cpp
│ ├── ReverseMapper.h
│ ├── Ternary
│ │ ├── KChartAbstractTernaryDiagram.cpp
│ │ ├── KChartAbstractTernaryDiagram.h
│ │ ├── KChartAbstractTernaryDiagram_p.h
│ │ ├── KChartTernaryAxis.cpp
│ │ ├── KChartTernaryAxis.h
│ │ ├── KChartTernaryCoordinatePlane.cpp
│ │ ├── KChartTernaryCoordinatePlane.h
│ │ ├── KChartTernaryCoordinatePlane_p.h
│ │ ├── KChartTernaryGrid.cpp
│ │ ├── KChartTernaryGrid.h
│ │ ├── KChartTernaryLineDiagram.cpp
│ │ ├── KChartTernaryLineDiagram.h
│ │ ├── KChartTernaryLineDiagram_p.h
│ │ ├── KChartTernaryPointDiagram.cpp
│ │ ├── KChartTernaryPointDiagram.h
│ │ ├── KChartTernaryPointDiagram_p.h
│ │ ├── TernaryConstants.cpp
│ │ ├── TernaryConstants.h
│ │ ├── TernaryPoint.cpp
│ │ └── TernaryPoint.h
│ ├── include
│ │ ├── KChart
│ │ ├── KChartAbstractArea
│ │ ├── KChartAbstractAreaBase
│ │ ├── KChartAbstractAreaWidget
│ │ ├── KChartAbstractAxis
│ │ ├── KChartAbstractCartesianDiagram
│ │ ├── KChartAbstractCoordinatePlane
│ │ ├── KChartAbstractDiagram
│ │ ├── KChartAbstractGrid
│ │ ├── KChartAbstractLayoutItem
│ │ ├── KChartAbstractPieDiagram
│ │ ├── KChartAbstractPolarDiagram
│ │ ├── KChartAbstractProxyModel
│ │ ├── KChartAbstractTernaryDiagram
│ │ ├── KChartAbstractThreeDAttributes
│ │ ├── KChartAttributesModel
│ │ ├── KChartAutoSpacerLayoutItem
│ │ ├── KChartBackgroundAttributes
│ │ ├── KChartBarAttributes
│ │ ├── KChartBarDiagram
│ │ ├── KChartCartesianAxis
│ │ ├── KChartCartesianCoordinatePlane
│ │ ├── KChartCartesianGrid
│ │ ├── KChartChart
│ │ ├── KChartDataValueAttributes
│ │ ├── KChartDatasetProxyModel
│ │ ├── KChartDatasetSelector
│ │ ├── KChartDatasetSelectorWidget
│ │ ├── KChartDiagramObserver
│ │ ├── KChartEnums
│ │ ├── KChartFrameAttributes
│ │ ├── KChartGlobal
│ │ ├── KChartGridAttributes
│ │ ├── KChartHeaderFooter
│ │ ├── KChartHorizontalLineLayoutItem
│ │ ├── KChartKDChartEnums
│ │ ├── KChartLayoutItems
│ │ ├── KChartLegend
│ │ ├── KChartLeveyJenningsAxis
│ │ ├── KChartLeveyJenningsCoordinatePlane
│ │ ├── KChartLeveyJenningsDiagram
│ │ ├── KChartLeveyJenningsGrid
│ │ ├── KChartLeveyJenningsGridAttributes
│ │ ├── KChartLineAttributes
│ │ ├── KChartLineDiagram
│ │ ├── KChartLineLayoutItem
│ │ ├── KChartLineWithMarkerLayoutItem
│ │ ├── KChartMarkerAttributes
│ │ ├── KChartMarkerLayoutItem
│ │ ├── KChartMeasure
│ │ ├── KChartNullPaintDevice
│ │ ├── KChartPaintContext
│ │ ├── KChartPalette
│ │ ├── KChartPieAttributes
│ │ ├── KChartPieDiagram
│ │ ├── KChartPlotter
│ │ ├── KChartPlotterDiagramCompressor
│ │ ├── KChartPolarCoordinatePlane
│ │ ├── KChartPolarDiagram
│ │ ├── KChartPolarGrid
│ │ ├── KChartPosition
│ │ ├── KChartPositionPoints
│ │ ├── KChartPrintingParameters
│ │ ├── KChartRadarCoordinatePlane
│ │ ├── KChartRadarDiagram
│ │ ├── KChartRadarGrid
│ │ ├── KChartRelativePosition
│ │ ├── KChartRingDiagram
│ │ ├── KChartRulerAttributes
│ │ ├── KChartSignalCompressor
│ │ ├── KChartStockBarAttributes
│ │ ├── KChartStockDiagram
│ │ ├── KChartTernaryAxis
│ │ ├── KChartTernaryCoordinatePlane
│ │ ├── KChartTernaryGrid
│ │ ├── KChartTernaryLineDiagram
│ │ ├── KChartTernaryPointDiagram
│ │ ├── KChartTextArea
│ │ ├── KChartTextAttributes
│ │ ├── KChartTextBubbleLayoutItem
│ │ ├── KChartTextLabelCache
│ │ ├── KChartTextLayoutItem
│ │ ├── KChartThreeDBarAttributes
│ │ ├── KChartThreeDLineAttributes
│ │ ├── KChartThreeDPieAttributes
│ │ ├── KChartValueTrackerAttributes
│ │ ├── KChartVerticalLineLayoutItem
│ │ ├── KChartWidget
│ │ └── KChartZoomParameters
│ ├── metainfo.yaml
│ └── resources
│ │ ├── circle_blue.svg
│ │ ├── circle_blue_red.svg
│ │ ├── karo_black.svg
│ │ ├── karo_blue.svg
│ │ └── karo_red.svg
├── KGantt
│ ├── CMakeLists.txt
│ ├── KGantt6Config.cmake.in
│ ├── Mainpage.dox
│ ├── Messages.sh
│ ├── kganttabstractgrid.cpp
│ ├── kganttabstractgrid.h
│ ├── kganttabstractgrid_p.h
│ ├── kganttabstractrowcontroller.cpp
│ ├── kganttabstractrowcontroller.h
│ ├── kganttconstraint.cpp
│ ├── kganttconstraint.h
│ ├── kganttconstraint_p.h
│ ├── kganttconstraintgraphicsitem.cpp
│ ├── kganttconstraintgraphicsitem.h
│ ├── kganttconstraintmodel.cpp
│ ├── kganttconstraintmodel.h
│ ├── kganttconstraintmodel_p.h
│ ├── kganttconstraintproxy.cpp
│ ├── kganttconstraintproxy.h
│ ├── kganttdatetimegrid.cpp
│ ├── kganttdatetimegrid.h
│ ├── kganttdatetimegrid_p.h
│ ├── kganttdatetimetimeline.cpp
│ ├── kganttdatetimetimeline.h
│ ├── kganttdatetimetimelinedialog.cpp
│ ├── kganttdatetimetimelinedialog.h
│ ├── kganttdatetimetimelinedialog.ui
│ ├── kganttforwardingproxymodel.cpp
│ ├── kganttforwardingproxymodel.h
│ ├── kganttglobal.cpp
│ ├── kganttglobal.h
│ ├── kganttgraphicsitem.cpp
│ ├── kganttgraphicsitem.h
│ ├── kganttgraphicsscene.cpp
│ ├── kganttgraphicsscene.h
│ ├── kganttgraphicsscene_p.h
│ ├── kganttgraphicsview.cpp
│ ├── kganttgraphicsview.h
│ ├── kganttgraphicsview_p.h
│ ├── kganttitemdelegate.cpp
│ ├── kganttitemdelegate.h
│ ├── kganttitemdelegate_p.h
│ ├── kganttlegend.cpp
│ ├── kganttlegend.h
│ ├── kganttlegend_p.h
│ ├── kganttlistviewrowcontroller.cpp
│ ├── kganttlistviewrowcontroller.h
│ ├── kganttlistviewrowcontroller_p.h
│ ├── kganttpenstylecombobox.cpp
│ ├── kganttpenstylecombobox.h
│ ├── kganttpenstylecombobox_p.h
│ ├── kganttprintingcontext.cpp
│ ├── kganttprintingcontext.h
│ ├── kganttproxymodel.cpp
│ ├── kganttproxymodel.h
│ ├── kganttproxymodel_p.h
│ ├── kganttstyleoptionganttitem.cpp
│ ├── kganttstyleoptionganttitem.h
│ ├── kganttsummaryhandlingproxymodel.cpp
│ ├── kganttsummaryhandlingproxymodel.h
│ ├── kganttsummaryhandlingproxymodel_p.h
│ ├── kgantttreeviewrowcontroller.cpp
│ ├── kgantttreeviewrowcontroller.h
│ ├── kgantttreeviewrowcontroller_p.h
│ ├── kganttview.cpp
│ ├── kganttview.h
│ ├── kganttview_p.h
│ ├── metainfo.yaml
│ ├── test
│ │ ├── CMakeLists.txt
│ │ ├── TestKGanttConstraint.cpp
│ │ ├── TestKGanttConstraint.h
│ │ ├── TestKGanttConstraintModel.cpp
│ │ ├── TestKGanttConstraintModel.h
│ │ ├── TestKGanttView.cpp
│ │ ├── TestKGanttView.h
│ │ ├── TestMultiItems.cpp
│ │ └── TestMultiItems.h
│ └── unittest
│ │ ├── libutil.h
│ │ ├── test.cpp
│ │ ├── test.h
│ │ ├── testregistry.cpp
│ │ └── testregistry.h
├── TODO
└── libkdchart.map
└── tests
├── CMakeLists.txt
├── DelayedData
├── CMakeLists.txt
└── main.cpp
├── Gantt
├── CMakeLists.txt
├── apireview
│ ├── CMakeLists.txt
│ ├── entrydelegate.cpp
│ ├── entrydelegate.h
│ ├── entrydialog.cpp
│ ├── entrydialog.h
│ ├── entrydialog.ui
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ └── mainwindow.ui
├── customconstraints
│ ├── CMakeLists.txt
│ └── main.cpp
├── gfxview
│ ├── CMakeLists.txt
│ └── main.cpp
├── headers
│ ├── CMakeLists.txt
│ └── main.cpp
├── listview
│ ├── CMakeLists.txt
│ └── main.cpp
├── reorder
│ ├── CMakeLists.txt
│ └── main.cpp
├── unittest
│ ├── CMakeLists.txt
│ └── main.cpp
└── view
│ ├── CMakeLists.txt
│ └── main.cpp
└── RootIndex
├── CMakeLists.txt
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
└── mainwindow.ui
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the following files
2 | *~
3 | *.[oa]
4 | *.diff
5 | *.kate-swp
6 | *.kdev4
7 | .kdev_include_paths
8 | *.kdevelop.pcs
9 | *.moc
10 | *.moc.cpp
11 | *.orig
12 | *.user
13 | .*.swp
14 | .swp.*
15 | Doxyfile
16 | Makefile
17 | avail
18 | random_seed
19 | /build*/
20 | CMakeLists.txt.user*
21 | *.unc-backup*
22 | .cmake/
23 | /.clang-format
24 | /compile_commands.json
25 | .clangd
26 | .idea
27 | /cmake-build*
28 | .cache
29 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | # SPDX-FileCopyrightText: None
2 | # SPDX-License-Identifier: CC0-1.0
3 |
4 | include:
5 | - project: sysadmin/ci-utilities
6 | file:
7 | - /gitlab-templates/linux-qt6.yml
8 | - /gitlab-templates/linux-qt6-next.yml
9 | - /gitlab-templates/freebsd-qt6.yml
10 | - /gitlab-templates/windows-qt6.yml
11 |
12 | - /gitlab-templates/xml-lint.yml
13 | - /gitlab-templates/yaml-lint.yml
14 |
--------------------------------------------------------------------------------
/.kde-ci.yml:
--------------------------------------------------------------------------------
1 | # SPDX-FileCopyrightText: None
2 | # SPDX-License-Identifier: CC0-1.0
3 |
4 | Dependencies:
5 | - 'on': ['Linux', 'FreeBSD', 'Windows', 'Android']
6 | 'require':
7 | 'frameworks/extra-cmake-modules': '@latest-kf6'
8 |
9 | Options:
10 | require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows']
11 |
--------------------------------------------------------------------------------
/Mainpage.dox:
--------------------------------------------------------------------------------
1 | /**
2 | \mainpage The KDiagram Libraries API Reference
3 |
4 | The KDE online class reference for the current development version of
5 | the KDiagram Libraries.
6 |
7 | The libraries available in this KDE module are:
8 |
9 | - KChart.
10 | A library for creating business charts.
11 |
12 | - KGantt.
13 | A library for creating Gantt diagrams.
14 |
15 | */
16 |
17 | // DOXYGEN_SET_PROJECT_NAME = KDiagram
18 | // DOXYGEN_EXCLUDE = examples qtests tests
19 |
--------------------------------------------------------------------------------
/examples/Axis/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Chart)
2 | add_subdirectory(Labels)
3 | add_subdirectory(Parameters)
4 | add_subdirectory(Widget)
5 |
--------------------------------------------------------------------------------
/examples/Axis/Chart/BarChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | barSimple.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Axis/Chart/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(AxisChart_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(AxisChart_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(AxisChart_SRCS
12 | BarChart.qrc
13 | )
14 |
15 | add_executable(AxisChart ${AxisChart_SRCS})
16 |
17 | target_link_libraries(AxisChart testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Axis/Chart/barSimple.csv:
--------------------------------------------------------------------------------
1 | "BarSimple","A","B","C","D"
2 | Item 1,0.5,1,0.5,0.7
3 | Item 2,1,0.5,1.5,0.8
4 | Item 3,1.5,2,0.7,1
5 | Item 4,0.7,0.3,1,2
6 | Item 5,1.3,2,1,0.6
7 | Item 6,2,1,3,0.5
8 | Item 7,1.9,1.1,2,0.6
9 |
--------------------------------------------------------------------------------
/examples/Axis/Chart/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv )
13 | {
14 | QApplication app( argc, argv );
15 |
16 | MainWindow mainWindow;
17 | mainWindow.show();
18 |
19 | return app.exec();
20 | }
21 |
--------------------------------------------------------------------------------
/examples/Axis/Chart/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart
16 | {
17 | class Chart;
18 | class BarDiagram;
19 | }
20 |
21 | class MainWindow : public QWidget, private Ui::MainWindow
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | MainWindow( QWidget* parent = nullptr );
27 |
28 |
29 | private:
30 | KChart::Chart* m_chart;
31 | TableModel m_model;
32 | KChart::BarDiagram* m_lines;
33 | };
34 |
35 |
36 | #endif /* MAINWINDOW_H */
37 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/AdjustedCartesianAxis.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "AdjustedCartesianAxis.h"
10 |
11 |
12 | AdjustedCartesianAxis::AdjustedCartesianAxis ( KChart::AbstractCartesianDiagram* diagram )
13 | : CartesianAxis ( diagram )
14 | , m_lowerBound(0.0)
15 | , m_upperBound(0.0)
16 | {
17 | // this block left empty intentionally
18 | }
19 |
20 | const QString AdjustedCartesianAxis::customizedLabel( const QString& label ) const
21 | {
22 | bool bOK;
23 | qreal val = label.toDouble( & bOK );
24 | if ( bOK ) {
25 | if ( val < m_lowerBound )
26 | return tr("LOW");
27 | else if ( val > m_upperBound )
28 | return tr("HIGH");
29 | }
30 | return label;
31 | }
32 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/AdjustedCartesianAxis.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef ADJUSTED_CARTESIAN_AXIS_H
10 | #define ADJUSTED_CARTESIAN_AXIS_H
11 |
12 | #include
13 | #include
14 |
15 |
16 | class AdjustedCartesianAxis: public KChart::CartesianAxis
17 | {
18 | Q_OBJECT
19 |
20 | Q_DISABLE_COPY( AdjustedCartesianAxis )
21 |
22 | public:
23 | explicit AdjustedCartesianAxis( KChart::AbstractCartesianDiagram* diagram = nullptr );
24 |
25 | const QString customizedLabel( const QString& label ) const override;
26 |
27 | void setBounds( qreal lower, qreal upper ) {
28 | m_lowerBound = lower;
29 | m_upperBound = upper;
30 | }
31 | qreal lowerBound() const { return m_lowerBound; }
32 | qreal upperBound() const { return m_upperBound; }
33 |
34 | private:
35 | qreal m_lowerBound;
36 | qreal m_upperBound;
37 | };
38 |
39 | #endif // ADJUSTED_CARTESIAN_AXIS_H
40 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/BarChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | barSimple.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(AxisLabels_SRCS
2 | AdjustedCartesianAxis.cpp
3 | mainwindow.cpp
4 | AdjustedCartesianAxis.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | qt_wrap_ui(AxisLabels_SRCS
10 | mainwindow.ui
11 | )
12 |
13 | qt_add_resources(AxisLabels_SRCS
14 | BarChart.qrc
15 | )
16 |
17 | add_executable(AxisLabels ${AxisLabels_SRCS})
18 |
19 | target_link_libraries(AxisLabels testtools KChart6 Qt::Widgets)
20 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/barSimple.csv:
--------------------------------------------------------------------------------
1 | "BarSimple","A","B","C","D"
2 | Item 1,4.5,5,4.5,4.7
3 | Item 2,5,4.5,5.5,4.8
4 | Item 3,5.5,1,8,0.5
5 | Item 4,2,4.3,5,6
6 | Item 5,5.3,6,5,4.6
7 | Item 6,5,5.2,4.7,5
8 | Item 7,5,4.5,5.5,4.8
9 | Item 8,5.3,6,5,4.6
10 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv )
13 | {
14 | QApplication app( argc, argv );
15 |
16 | MainWindow mainWindow;
17 | mainWindow.show();
18 |
19 | return app.exec();
20 | }
21 |
--------------------------------------------------------------------------------
/examples/Axis/Labels/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class DatasetProxyModel;
18 | class LineDiagram;
19 | class CartesianAxis;
20 | class Legend;
21 | }
22 |
23 | class MainWindow : public QWidget, private Ui::MainWindow
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | MainWindow( QWidget* parent = nullptr );
29 |
30 | private Q_SLOTS:
31 | void annotationsToggled( bool );
32 | void gridLinesOnAnnotationsToggled( bool );
33 |
34 | private:
35 | KChart::Chart* m_chart;
36 | KChart::CartesianAxis* m_xAxis;
37 | TableModel m_model;
38 | KChart::DatasetProxyModel* m_datasetProxy;
39 | KChart::LineDiagram* m_lines;
40 | KChart::Legend* m_legend;
41 | };
42 |
43 |
44 | #endif /* MAINWINDOW_H */
45 |
46 |
--------------------------------------------------------------------------------
/examples/Axis/Parameters/Axes.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Axis/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(AxisParameters_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(AxisParameters_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(AxisParameters_SRCS
12 | Axes.qrc
13 | )
14 |
15 | add_executable(AxisParameters ${AxisParameters_SRCS})
16 |
17 | target_link_libraries(AxisParameters testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Axis/Parameters/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Axis/Widget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(AxisWidget main.cpp)
2 |
3 | target_link_libraries(AxisWidget KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Background/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(Background main.cpp)
2 |
3 | target_link_libraries(Background KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Background/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/kdiagram/6cb22b406cd7b91acdd465307e6a6e4c72b78190/examples/Background/background.png
--------------------------------------------------------------------------------
/examples/Bars/Advanced/BarChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | barSimple.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Bars/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(BarsAdvanced_SRCS
2 | mainwindow.h
3 | mainwindow.cpp
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(BarsAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(BarsAdvanced_SRCS
12 | BarChart.qrc
13 | )
14 |
15 | add_executable(BarsAdvanced ${BarsAdvanced_SRCS})
16 |
17 | target_link_libraries(BarsAdvanced testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Bars/Advanced/barSimple.csv:
--------------------------------------------------------------------------------
1 | "BarSimple","A","B","C","D"
2 | 1,0.5,1,0.5,0.7
3 | 2,1,0.5,1.5,0.8
4 | 3,1.5,2,0.7,1
5 | 4,0.7,0.3,1,2
6 | 5,1.3,2,1,0.6
7 | 6,2,1,3,0.5
--------------------------------------------------------------------------------
/examples/Bars/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Bars/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(Parameters)
3 | add_subdirectory(Simple)
4 |
--------------------------------------------------------------------------------
/examples/Bars/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(BarsParameters main.cpp)
2 |
3 | target_link_libraries(BarsParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Bars/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(BarsSimple main.cpp)
2 |
3 | target_link_libraries(BarsSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/DataValueTexts/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(DataValueTexts_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(DataValueTexts_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(DataValueTexts_SRCS
12 | DataValueTexts.qrc
13 | )
14 |
15 | add_executable(DataValueTexts ${DataValueTexts_SRCS})
16 |
17 | target_link_libraries(DataValueTexts testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/DataValueTexts/DataValueTexts.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | barPositiveNegative.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/DataValueTexts/barPositiveNegative.csv:
--------------------------------------------------------------------------------
1 | "BarPositiveNegative","A","B","C","D"
2 | 1,0.2.5,1.75,0.7,1
3 | 2,-0.7,0.4,0.2,1.8
4 | 3,-1.3,1.7,-0.4,0.6
5 | 4,-0.5,1,-1.0,0.5
6 |
--------------------------------------------------------------------------------
/examples/DataValueTexts/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/DrawIntoPainter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(DrawIntoPainter_SRCS
2 | framewidget.cpp
3 | mainwindow.cpp
4 | framewidget.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | qt_wrap_ui(DrawIntoPainter_SRCS
10 | mainwindow.ui
11 | )
12 |
13 | qt_add_resources(DrawIntoPainter_SRCS
14 | DrawIntoPainter.qrc
15 | )
16 |
17 | add_executable(DrawIntoPainter ${DrawIntoPainter_SRCS})
18 |
19 | target_link_libraries(DrawIntoPainter testtools KChart6 Qt::Widgets Qt::PrintSupport)
20 |
--------------------------------------------------------------------------------
/examples/DrawIntoPainter/DrawIntoPainter.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../tools/modeldata/KChart-Test-Linear.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/DrawIntoPainter/framewidget.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef FRAMEWIDGET_H
10 | #define FRAMEWIDGET_H
11 |
12 | #include
13 |
14 | namespace KChart {
15 | class Chart;
16 | }
17 |
18 |
19 | class FrameWidget : public QWidget
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | explicit FrameWidget( QWidget * parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
25 |
26 | void paintEvent( QPaintEvent* ) override;
27 |
28 | void setChart( KChart::Chart* chart );
29 |
30 | private:
31 | KChart::Chart* mChart;
32 | };
33 |
34 |
35 | #endif /* FRAMEWIDGET_H */
36 |
37 |
--------------------------------------------------------------------------------
/examples/DrawIntoPainter/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/EmptyValues/BarChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | barSimple.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/EmptyValues/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(EmptyValues_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_add_resources(EmptyValues_SRCS
8 | BarChart.qrc
9 | )
10 |
11 | add_executable(EmptyValues ${EmptyValues_SRCS})
12 |
13 | target_link_libraries(EmptyValues testtools KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/EmptyValues/barSimple.csv:
--------------------------------------------------------------------------------
1 | "BarSimple","A","B","C","D"
2 | 1,0.0,0.0,0.0,0.0
3 | 2,0.0,0.0,0.0,0.0
4 | 3,0.0,0.0,0.0,0.0
5 | 4,0.0,0.0,0.0,0.0
6 | 5,0.0,0.0,0.0,0.0
7 | 6,0.0,0.0,0.0,0.0
8 |
--------------------------------------------------------------------------------
/examples/EmptyValues/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/EmptyValues/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class BarDiagram;
18 | }
19 |
20 | class MainWindow : public QWidget
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | MainWindow( QWidget* parent = nullptr );
26 | ~MainWindow() override { }
27 |
28 | private:
29 | KChart::Chart* m_chart;
30 | KChart::BarDiagram* m_bars;
31 | TableModel m_model;
32 | };
33 |
34 |
35 | #endif /* MAINWINDOW_H */
36 |
37 |
--------------------------------------------------------------------------------
/examples/Gantt/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | remove_definitions(
2 | -DQT_NO_KEYWORDS
3 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS
4 | -DQT_NO_CAST_FROM_ASCII
5 | )
6 |
7 | add_subdirectory(legend_example)
8 | add_subdirectory(project)
9 | add_subdirectory(palette)
10 | add_subdirectory(printing)
11 |
--------------------------------------------------------------------------------
/examples/Gantt/legend_example/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(legend_example_SRCS
2 | entrydialog.cpp
3 | entrydelegate.cpp
4 | mainwindow.cpp
5 | entrydialog.h
6 | entrydelegate.h
7 | mainwindow.h
8 | main.cpp
9 | )
10 |
11 | qt_wrap_ui(legend_example_SRCS
12 | entrydialog.ui
13 | mainwindow.ui
14 | )
15 |
16 | add_executable(legend_example ${legend_example_SRCS})
17 |
18 | target_link_libraries(legend_example KGantt6 Qt::Widgets Qt::PrintSupport)
19 |
--------------------------------------------------------------------------------
/examples/Gantt/legend_example/entrydelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef ENTRYDELEGATE_H
10 | #define ENTRYDELEGATE_H
11 |
12 | #include
13 |
14 | namespace KGantt {
15 | class ConstraintModel;
16 | }
17 |
18 | class EntryDelegate : public QItemDelegate {
19 | public:
20 | explicit EntryDelegate( KGantt::ConstraintModel* constraintModel, QObject* parent = nullptr );
21 |
22 | bool editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index ) override;
23 |
24 | private:
25 | void addConstraint(const QModelIndex & index1, const QModelIndex & index2);
26 | void setReadOnly(const QModelIndex & index, bool readOnly);
27 |
28 | KGantt::ConstraintModel* constraintModel;
29 | };
30 |
31 | #endif /* ENTRYDELEGATE_H */
32 |
--------------------------------------------------------------------------------
/examples/Gantt/legend_example/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include "mainwindow.h"
12 |
13 | int main( int argc, char* argv[] )
14 | {
15 | QApplication app( argc, argv );
16 |
17 | MainWindow mainWin;
18 | mainWin.show();
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/examples/Gantt/legend_example/mainwindow.ui:
--------------------------------------------------------------------------------
1 |
2 | MainWindow
3 |
4 |
5 |
6 | 0
7 | 0
8 | 556
9 | 330
10 |
11 |
12 |
13 | Qt::DefaultContextMenu
14 |
15 |
16 | KD Gantt Example
17 |
18 |
19 |
20 | -
21 |
22 |
23 |
24 |
25 |
35 |
36 |
37 |
38 |
39 | KGantt::View
40 | QWidget
41 |
42 | 1
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/examples/Gantt/palette/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(GanttPalette_SRCS
2 | ../common/projectmodel.cpp
3 | mainwindow.cpp
4 | ../common/projectmodel.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | add_executable(GanttPalette ${GanttPalette_SRCS})
10 |
11 | target_link_libraries(GanttPalette KGantt6 Qt::Widgets Qt::PrintSupport)
12 |
--------------------------------------------------------------------------------
/examples/Gantt/printing/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(GanttPrinting_SRCS
2 | ../common/projectmodel.cpp
3 | mainwindow.cpp
4 | ../common/projectmodel.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | add_executable(GanttPrinting ${GanttPrinting_SRCS})
10 |
11 | target_link_libraries(GanttPrinting KGantt6 Qt::Widgets Qt::PrintSupport)
12 |
--------------------------------------------------------------------------------
/examples/Gantt/project/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(project_SRCS
2 | ../common/projectmodel.cpp
3 | mainwindow.cpp
4 | ../common/projectmodel.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | add_executable(project ${project_SRCS})
10 |
11 | target_link_libraries(project KGantt6 Qt::Widgets Qt::PrintSupport)
12 |
--------------------------------------------------------------------------------
/examples/Gantt/project/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include "mainwindow.h"
12 |
13 | int main( int argc, char** argv ) {
14 | QApplication app( argc, argv );
15 |
16 | MainWindow mw;
17 | mw.resize( 800, 600 );
18 | mw.show();
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/examples/Grids/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(CartesianGrid)
2 | add_subdirectory(PolarGrid)
3 |
--------------------------------------------------------------------------------
/examples/Grids/CartesianGrid/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(CartesianGrid main.cpp)
2 |
3 | target_link_libraries(CartesianGrid KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Grids/PolarGrid/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(PolarGrid_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(PolarGrid_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(PolarGrid ${PolarGrid_SRCS})
12 |
13 | target_link_libraries(PolarGrid KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/Grids/PolarGrid/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(HeadersFootersAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(HeadersFootersAdvanced_SRCS
8 | addheaderdialog.ui
9 | mainwindow.ui
10 | )
11 |
12 | qt_add_resources(HeadersFootersAdvanced_SRCS
13 | HeadersFooters.qrc
14 | )
15 |
16 | add_executable(HeadersFootersAdvanced ${HeadersFootersAdvanced_SRCS})
17 |
18 | target_link_libraries(HeadersFootersAdvanced testtools KChart6 Qt::Widgets Qt::PrintSupport)
19 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/Advanced/HeadersFooters.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(HeadersFootersParameters)
3 | add_subdirectory(HeadersFootersSimple)
4 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/HeadersFootersParameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(HeadersFootersParameters main.cpp)
2 |
3 | target_link_libraries(HeadersFootersParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/HeadersFootersSimple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(HeadersFootersSimple main.cpp)
2 |
3 | target_link_libraries(HeadersFootersSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/HeadersFooters/HeadersFootersSimple/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 |
15 | using namespace KChart;
16 |
17 | int main( int argc, char** argv ) {
18 | QApplication app( argc, argv );
19 |
20 | Widget widget;
21 | widget.resize( 600, 600 );
22 |
23 | QVector< qreal > vec0, vec1, vec2;
24 |
25 | vec0 << -5 << -4 << -3 << -2 << -1 << 0
26 | << 1 << 2 << 3 << 4 << 5;
27 | vec1 << 25 << 16 << 9 << 4 << 1 << 0
28 | << 1 << 4 << 9 << 16 << 25;
29 | vec2 << -125 << -64 << -27 << -8 << -1 << 0
30 | << 1 << 8 << 27 << 64 << 125;
31 |
32 | widget.setDataset( 0, vec0, "v0" );
33 | widget.setDataset( 1, vec1, "v1" );
34 | widget.setDataset( 2, vec2, "v2" );
35 | widget.setType( Widget::Bar );
36 | widget.addHeaderFooter("A default Header - North", HeaderFooter::Header, Position::North);
37 | widget.addHeaderFooter("A default Footer - South", HeaderFooter::Footer, Position::South);
38 |
39 | widget.show();
40 |
41 | return app.exec();
42 | }
43 |
--------------------------------------------------------------------------------
/examples/Legends/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(LegendAdvanced)
2 | add_subdirectory(LegendOverDiagram)
3 | add_subdirectory(LegendParameters)
4 | add_subdirectory(LegendSimple)
5 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LegendAdvanced_SRCS
2 | derivedaddlegenddialog.cpp
3 | mainwindow.cpp
4 | derivedaddlegenddialog.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | qt_wrap_ui(LegendAdvanced_SRCS
10 | addlegenddialog.ui
11 | mainwindow.ui
12 | )
13 |
14 | qt_add_resources(LegendAdvanced_SRCS
15 | Legends.qrc
16 | )
17 |
18 | add_executable(LegendAdvanced ${LegendAdvanced_SRCS})
19 |
20 | target_link_libraries(LegendAdvanced testtools KChart6 Qt::Widgets)
21 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/Legends.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/derivedaddlegenddialog.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "derivedaddlegenddialog.h"
10 |
11 | #include
12 |
13 |
14 | DerivedAddLegendDialog::DerivedAddLegendDialog( QWidget* parent ) :
15 | QDialog( parent )
16 | {
17 | setupUi(this);
18 | }
19 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/derivedaddlegenddialog.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef DERIVEDADDLEGENDDIALOG_H
10 | #define DERIVEDADDLEGENDDIALOG_H
11 |
12 | #include "ui_addlegenddialog.h"
13 |
14 | class DerivedAddLegendDialog : public QDialog, public Ui::AddLegendDialog
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | DerivedAddLegendDialog( QWidget* parent = nullptr );
20 | };
21 |
22 | #endif // DERIVEDADDLEGENDDIALOG_H
23 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Legends/LegendAdvanced/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include
13 | #include
14 |
15 | #include "ui_mainwindow.h"
16 | #include "derivedaddlegenddialog.h"
17 | #include
18 |
19 | namespace KChart {
20 | class Chart;
21 | class LineDiagram;
22 | }
23 |
24 | class MainWindow : public QWidget, private Ui::MainWindow
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | MainWindow( QWidget* parent = nullptr );
30 |
31 | private Q_SLOTS:
32 | void on_addLegendPB_clicked();
33 | void on_editLegendPB_clicked();
34 | void on_removeLegendPB_clicked();
35 | void on_legendsTV_itemSelectionChanged();
36 |
37 | private:
38 | void initAddLegendDialog( DerivedAddLegendDialog& conf,
39 | Qt::Alignment alignment ) const;
40 |
41 | KChart::Chart* m_chart;
42 | TableModel m_model;
43 | KChart::LineDiagram* m_lines;
44 | QMap alignmentMap;
45 | };
46 |
47 |
48 | #endif /* MAINWINDOW_H */
49 |
50 |
--------------------------------------------------------------------------------
/examples/Legends/LegendOverDiagram/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(LegendOverDiagram main.cpp)
2 |
3 | target_link_libraries(LegendOverDiagram KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Legends/LegendParameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(LegendParameters main.cpp)
2 |
3 | target_link_libraries(LegendParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Legends/LegendSimple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(LegendSimple main.cpp)
2 |
3 | target_link_libraries(LegendSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/LeveyJennings/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Simple)
2 |
--------------------------------------------------------------------------------
/examples/LeveyJennings/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(LeveyJenningsSimple main.cpp)
2 |
3 | target_link_libraries(LeveyJenningsSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Lines/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LinesAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(LinesAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(LinesAdvanced_SRCS
12 | LineChart.qrc
13 | )
14 |
15 | add_executable(LinesAdvanced ${LinesAdvanced_SRCS})
16 |
17 | target_link_libraries(LinesAdvanced testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Lines/Advanced/LineChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | lineAnimate.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Lines/Advanced/lineAnimate.csv:
--------------------------------------------------------------------------------
1 | "LineAnimate","A","B","C","D"
2 | 1, 29.5 , 30 , 29.5 , 29.7
3 | 2, 30 , 29.5, 30.5 , 29.8
4 | 3, 30.5 , 31 , 29.7 , 30
5 | 4, 29.7 , 29.3, 30 , 31
6 | 5, 30.3 , 31 , 30 , 29.6
7 | 6, 29.4 , 30 , 34 , 29.5
8 |
--------------------------------------------------------------------------------
/examples/Lines/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Lines/AreaPerCell/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(AreaPerCell main.cpp)
2 |
3 | target_link_libraries(AreaPerCell KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Lines/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(AreaPerCell)
3 | add_subdirectory(Parameters)
4 | add_subdirectory(PointChart)
5 | add_subdirectory(PointWidget)
6 | add_subdirectory(SimpleLineWidget)
7 |
--------------------------------------------------------------------------------
/examples/Lines/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(Parameters main.cpp)
2 |
3 | target_link_libraries(Parameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Lines/PointChart/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(PointChart_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(PointChart_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(PointChart_SRCS
12 | LineChart.qrc
13 | )
14 |
15 | add_executable(PointChart ${PointChart_SRCS})
16 |
17 | target_link_libraries(PointChart testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Lines/PointChart/LineChart.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | line.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Lines/PointChart/line.csv:
--------------------------------------------------------------------------------
1 | "LineAnimate","A","B","C","D"
2 | 1,0.5,1,0.5,0.7
3 | 2,1,0.5,1.5,0.8
4 | 3,1.5,2,0.7,1
5 | 4,0.7,0.3,1,2
6 | 5,1.3,2,1,0.6
7 | 6,2,1,3,0.5
8 |
--------------------------------------------------------------------------------
/examples/Lines/PointChart/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Lines/PointWidget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PointWidget main.cpp)
2 |
3 | target_link_libraries(PointWidget KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Lines/SimpleLineWidget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(SimpleLineWidget main.cpp)
2 |
3 | target_link_libraries(SimpleLineWidget KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/ModelView/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(HidingData)
2 | add_subdirectory(TableView)
3 |
--------------------------------------------------------------------------------
/examples/ModelView/HidingData/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(HidingData_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(HidingData_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(HidingData_SRCS
12 | ModelView.qrc
13 | )
14 |
15 | add_executable(HidingData ${HidingData_SRCS})
16 |
17 | target_link_libraries(HidingData testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/ModelView/HidingData/ModelView.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | qtdata.cht
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/ModelView/HidingData/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/ModelView/HidingData/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 |
14 | QT_BEGIN_NAMESPACE
15 | class QAbstractItemModel;
16 | QT_END_NAMESPACE
17 |
18 | namespace KChart {
19 | class Chart;
20 | class LineDiagram;
21 | }
22 |
23 | class MainWindow : public QWidget, private Ui::MainWindow
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | MainWindow( QWidget* parent = nullptr );
29 |
30 | private Q_SLOTS:
31 | void on_showDataset1CB_toggled( bool checked );
32 | void on_showDataset2CB_toggled( bool checked );
33 | void on_showDataset3CB_toggled( bool checked );
34 | void setHidden( int dataset, bool hidden );
35 | void openFile(const QString &path);
36 |
37 | private:
38 | KChart::Chart * m_chart;
39 | KChart::LineDiagram * m_lines;
40 | QAbstractItemModel * m_model;
41 | };
42 |
43 |
44 | #endif /* MAINWINDOW_H */
45 |
46 |
--------------------------------------------------------------------------------
/examples/ModelView/HidingData/qtdata.cht:
--------------------------------------------------------------------------------
1 | 21,17,12
2 | 18,20,15
3 | 14,20,8
4 | 13,19,11
5 | 13,11,20
6 | 13,10,6
7 | 12,12,0
8 | 11,13,3
9 | 9,15,13
10 | 9,14,14
11 | 7,13,8
12 | 6,16,2
13 | 11,15,0
14 | 28,16,10
15 |
--------------------------------------------------------------------------------
/examples/ModelView/TableView/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TableView_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_add_resources(TableView_SRCS
8 | ModelView.qrc
9 | )
10 |
11 | add_executable(TableView ${TableView_SRCS})
12 |
13 | target_link_libraries(TableView testtools KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/ModelView/TableView/ModelView.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | qtdata.cht
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/ModelView/TableView/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/ModelView/TableView/qtdata.cht:
--------------------------------------------------------------------------------
1 | Scientific Research,21,12,#99e600
2 | Engineering & Design,18,15,#99cc00
3 | Automotive,14,8,#99b300
4 | Aerospace,13,11,#9f991a
5 | Automation & Machine Tools,13,20,#a48033
6 | Medical & Bioinformatics,13,6,#a9664d
7 | Imaging & Special Effects,12,0,#ae4d66
8 | Defense,11,3,#b33380
9 | Test & Measurement Systems,9,13,#a64086
10 | Oil & Gas,9,14,#994d8d
11 | Entertainment & Broadcasting,7,8,#8d5a93
12 | Financial,6,2,#806699
13 | Consumer Electronics,4,0,#8073a6
14 | Other,38,10,#8080b3
15 |
--------------------------------------------------------------------------------
/examples/NoValues/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(NoValues_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | add_executable(NoValues ${NoValues_SRCS})
8 |
9 | target_link_libraries(NoValues KChart6 Qt::Widgets)
10 |
--------------------------------------------------------------------------------
/examples/NoValues/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 | mainWindow.setWindowTitle(QObject::tr("You can have a chart without having any data at all."));
18 |
19 | return app.exec();
20 | }
21 |
--------------------------------------------------------------------------------
/examples/NoValues/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class BarDiagram;
18 | class LineDiagram;
19 | }
20 |
21 | class MainWindow : public QWidget
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | MainWindow( QWidget* parent = nullptr );
27 | ~MainWindow() override { }
28 |
29 | private:
30 | KChart::Chart* m_chart;
31 | KChart::LineDiagram* m_bars;
32 | QAbstractItemModel* m_model;
33 | };
34 |
35 |
36 | #endif /* MAINWINDOW_H */
37 |
38 |
--------------------------------------------------------------------------------
/examples/Pie/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(PieAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(PieAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(PieAdvanced_SRCS
12 | Pie.qrc
13 | )
14 |
15 | add_executable(PieAdvanced ${PieAdvanced_SRCS})
16 |
17 | target_link_libraries(PieAdvanced testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Pie/Advanced/Pie.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Pie.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Pie/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Pie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(Parameters)
3 | add_subdirectory(Simple)
4 |
--------------------------------------------------------------------------------
/examples/Pie/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PieParameters main.cpp)
2 |
3 | target_link_libraries(PieParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Pie/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PieSimple main.cpp)
2 |
3 | target_link_libraries(PieSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plane/AdjustedBoundaries/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(AdjustedBoundaries main.cpp)
2 |
3 | target_link_libraries(AdjustedBoundaries KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plane/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(AdjustedBoundaries)
2 | add_subdirectory(OverlayedPlanes)
3 |
--------------------------------------------------------------------------------
/examples/Plane/OverlayedPlanes/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(OverlayedPlanes_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(OverlayedPlanes_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(OverlayedPlanes_SRCS
12 | OverlayedPlanes.qrc
13 | )
14 |
15 | add_executable(OverlayedPlanes ${OverlayedPlanes_SRCS})
16 |
17 | target_link_libraries(OverlayedPlanes testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Plane/OverlayedPlanes/OverlayedPlanes.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 | ../../tools/modeldata/KChart-Test_Linear_Two_Columns.csv
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/Plane/OverlayedPlanes/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Plane/OverlayedPlanes/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class DatasetProxyModel;
18 | class LineDiagram;
19 | class LineAttributes;
20 | class CartesianAxis;
21 | class CartesianCoordinatePlane;
22 | }
23 |
24 | class MainWindow : public QWidget, private Ui::MainWindow
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | MainWindow( QWidget* parent = nullptr );
30 |
31 | private Q_SLOTS:
32 |
33 | void on_displayGrid1CB_toggled( bool checked );
34 | void on_displayGrid2CB_toggled( bool checked );
35 |
36 | private:
37 | void init();
38 | KChart::Chart* m_chart;
39 | TableModel m_model;
40 | TableModel m_model2;
41 | KChart::DatasetProxyModel* m_datasetProxy;
42 | KChart::LineDiagram* m_lines;
43 | KChart::LineDiagram* m_lines2;
44 | KChart::CartesianCoordinatePlane* plane2;
45 |
46 |
47 | };
48 |
49 |
50 | #endif /* MAINWINDOW_H */
51 |
52 |
--------------------------------------------------------------------------------
/examples/Plotter/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PlotterAdvanced main.cpp)
2 |
3 | target_link_libraries(PlotterAdvanced KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plotter/BigDataset/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(BigDataset_SRCS
2 | MainWidget.cpp
3 | Model.cpp
4 | MainWidget.h
5 | Model.h
6 | main.cpp
7 | )
8 |
9 | qt_wrap_ui(BigDataset_SRCS
10 | Controls.ui
11 | )
12 |
13 | add_executable(BigDataset ${BigDataset_SRCS})
14 |
15 | target_link_libraries(BigDataset KChart6 Qt::Widgets)
16 |
--------------------------------------------------------------------------------
/examples/Plotter/BigDataset/MainWidget.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWIDGET_H
10 | #define MAINWIDGET_H
11 |
12 | #include "Model.h"
13 |
14 | #include "ui_Controls.h"
15 |
16 | #include
17 |
18 |
19 |
20 | namespace KChart {
21 | class Plotter;
22 | }
23 |
24 | class Model;
25 | class QPushButton;
26 | class QRadioButton;
27 |
28 | class MainWidget : public QWidget
29 | {
30 | Q_OBJECT
31 | public:
32 | MainWidget();
33 |
34 | private Q_SLOTS:
35 | void functionToggled( bool checked );
36 | void addPointsButtonClicked();
37 |
38 | private:
39 | QWidget* m_controlsContainer;
40 | Ui::Controls m_controls;
41 | QVector< QRadioButton* > m_functionSelector;
42 | QVector< QPushButton* > m_addPointsButtons;
43 |
44 | KChart::Plotter* m_plotter;
45 | Model m_model;
46 | };
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/examples/Plotter/BigDataset/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "MainWidget.h"
10 |
11 | #include
12 |
13 | int main( int argc, char* argv[] )
14 | {
15 | QApplication app( argc, argv );
16 | MainWidget mainWidget;
17 | mainWidget.show();
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Plotter/BubbleChart/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(BubbleChart_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(BubbleChart_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(BubbleChart ${BubbleChart_SRCS})
12 |
13 | target_link_libraries(BubbleChart KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/Plotter/BubbleChart/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Plotter/BubbleChart/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 |
14 | QT_BEGIN_NAMESPACE
15 | class QStandardItemModel;
16 | QT_END_NAMESPACE
17 |
18 | namespace KChart {
19 | class Chart;
20 | class Plotter;
21 | }
22 |
23 | class MainWindow : public QWidget, private Ui::MainWindow
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | MainWindow( QWidget* parent = nullptr );
29 |
30 | private Q_SLOTS:
31 | void initializeDataModel();
32 | void setMarkerAttributes();
33 |
34 | private:
35 | QStandardItemModel* m_model;
36 | KChart::Chart* m_chart;
37 | KChart::Plotter* m_plotter;
38 | };
39 |
40 |
41 | #endif /* MAINWINDOW_H */
42 |
43 |
--------------------------------------------------------------------------------
/examples/Plotter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(BigDataset)
3 | add_subdirectory(BubbleChart)
4 | add_subdirectory(Isometric)
5 | add_subdirectory(Logarithmic)
6 | add_subdirectory(Simple)
7 | add_subdirectory(Timeline)
8 |
--------------------------------------------------------------------------------
/examples/Plotter/Isometric/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(Isometric main.cpp)
2 |
3 | target_link_libraries(Isometric KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plotter/Logarithmic/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(Logarithmic main.cpp)
2 |
3 | target_link_libraries(Logarithmic KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plotter/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PlotterSimple main.cpp)
2 |
3 | target_link_libraries(PlotterSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Plotter/Timeline/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(PlotterTimeline_SRCS
2 | timeaxis.cpp
3 | timechartmodel.cpp
4 | timeaxis.h
5 | timechartmodel.h
6 | main.cpp
7 | )
8 |
9 | add_executable(PlotterTimeline ${PlotterTimeline_SRCS})
10 |
11 | target_link_libraries(PlotterTimeline KChart6 Qt::Widgets)
12 |
--------------------------------------------------------------------------------
/examples/Plotter/Timeline/timeaxis.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "timeaxis.h"
10 |
11 | #include
12 |
13 | TimeAxis::TimeAxis( KChart::AbstractCartesianDiagram* parent )
14 | : KChart::CartesianAxis( parent )
15 | {
16 | // Intentionally left blank
17 | }
18 |
19 | const QString TimeAxis::customizedLabel( const QString& label ) const
20 | {
21 | // Here we are free to format the value to whatever we want. As example we
22 | // could also return a scientific notation with something like the following
23 | // both lines;
24 | //const int precision = 2;
25 | //return QString::number(label.toReal(), 'E', precision);
26 |
27 | // Format the time-value to a nice string representation.
28 | const QDateTime dateTime = QDateTime::fromSecsSinceEpoch( label.toDouble() * 3600.0 );
29 | return dateTime.date().toString();
30 | }
31 |
--------------------------------------------------------------------------------
/examples/Plotter/Timeline/timeaxis.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef TIMEAXIS_H
10 | #define TIMEAXIS_H
11 |
12 | #include
13 |
14 | class TimeAxis : public KChart::CartesianAxis
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit TimeAxis( KChart::AbstractCartesianDiagram* parent );
19 | const QString customizedLabel( const QString& label ) const override;
20 | };
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/examples/Plotter/Timeline/timechartmodel.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef TIMECHARTMODEL_H
10 | #define TIMECHARTMODEL_H
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | class TimeChartModel : public QSortFilterProxyModel
17 | {
18 | Q_OBJECT
19 | public:
20 | explicit TimeChartModel( QObject* parent = nullptr );
21 |
22 | QPair< QDateTime, QDateTime > visibleRange() const;
23 |
24 | QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
25 |
26 | public Q_SLOTS:
27 | void setVisibleRange( const QDateTime& start, const QDateTime& end );
28 | void setVisibleStart( const QDateTime& start );
29 | void setVisibleEnd( const QDateTime& end );
30 |
31 | protected:
32 | bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const override;
33 |
34 | private:
35 | QPair< QDateTime, QDateTime > range;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/examples/Polar/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(PolarAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(PolarAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(PolarAdvanced ${PolarAdvanced_SRCS})
12 |
13 | target_link_libraries(PolarAdvanced KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/Polar/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include "mainwindow.h"
12 |
13 | int main( int argc, char** argv ) {
14 | QApplication app( argc, argv );
15 |
16 | MainWindow mainWindow;
17 | mainWindow.show();
18 |
19 | return app.exec();
20 | }
21 |
--------------------------------------------------------------------------------
/examples/Polar/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(Parameters)
3 | add_subdirectory(Simple)
4 |
--------------------------------------------------------------------------------
/examples/Polar/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PolarParameters main.cpp)
2 |
3 | target_link_libraries(PolarParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Polar/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(PolarSimple main.cpp)
2 |
3 | target_link_libraries(PolarSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Polar/Simple/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 |
13 |
14 | using namespace KChart;
15 |
16 | int main( int argc, char** argv ) {
17 | QApplication app( argc, argv );
18 |
19 | Widget widget;
20 | widget.resize( 600, 600 );
21 |
22 | QVector< qreal > vec0, vec1, vec2;
23 |
24 | vec0 << -5 << -4 << -3 << -2 << -1 << 0
25 | << 1 << 2 << 3 << 4 << 5;
26 | vec1 << 25 << 16 << 9 << 4 << 1 << 0
27 | << 1 << 4 << 9 << 16 << 25;
28 | vec2 << -125 << -64 << -27 << -8 << -1 << 0
29 | << 1 << 8 << 27 << 64 << 125;
30 |
31 | widget.setDataset( 0, vec0, "v0" );
32 | widget.setDataset( 1, vec1, "v1" );
33 | widget.setDataset( 2, vec2, "v2" );
34 | widget.setType( Widget::Polar );
35 | widget.setGlobalLeading( 5, 5, 5, 5 );
36 |
37 | widget.show();
38 |
39 | return app.exec();
40 | }
41 |
--------------------------------------------------------------------------------
/examples/README.txt:
--------------------------------------------------------------------------------
1 | Running the examples
2 |
3 | The examples are only compiled automatically if you pass the -unittests option
4 | to configure. This is because some examples require the "testtools" internal
5 | library that is not installed when configured without -unittests.
6 |
7 | If you run configure without -unittests, you can still compile the examples
8 | by running "make" in the examples directory. For those examples that require
9 | the testtools library to run, you can help the linker find it by adding
10 | /path/to/kchart_build_dir/lib to the library search path.
11 |
12 | The library search path is called:
13 | - Linux: LD_LIBRARY_PATH
14 | - Windows: PATH
15 | - Mac OS X: DYLD_LIBRARY_PATH
16 |
--------------------------------------------------------------------------------
/examples/RealTime/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(RealTime main.cpp)
2 |
3 | target_link_libraries(RealTime KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/SharedAbscissa/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(SeparateDiagrams)
2 |
--------------------------------------------------------------------------------
/examples/SharedAbscissa/SeparateDiagrams/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(SeparateDiagrams_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(SeparateDiagrams_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(SeparateDiagrams_SRCS
12 | SharedAbscissa.qrc
13 | )
14 |
15 | add_executable(SeparateDiagrams ${SeparateDiagrams_SRCS})
16 |
17 | target_link_libraries(SeparateDiagrams testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/SharedAbscissa/SeparateDiagrams/SharedAbscissa.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 | ../../tools/modeldata/KChart-Test_Linear_Two_Columns.csv
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/SharedAbscissa/SeparateDiagrams/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/SharedAbscissa/SeparateDiagrams/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class DatasetProxyModel;
18 | class LineDiagram;
19 | class LineAttributes;
20 | class CartesianAxis;
21 | class CartesianCoordinatePlane;
22 | }
23 |
24 | class MainWindow : public QWidget, private Ui::MainWindow
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | MainWindow( QWidget* parent = nullptr );
30 |
31 | private:
32 | KChart::Chart* m_chart;
33 | TableModel m_model;
34 | TableModel m_model2;
35 | KChart::DatasetProxyModel* m_datasetProxy;
36 | KChart::LineDiagram* m_lines;
37 | KChart::LineDiagram* m_lines2;
38 | KChart::CartesianCoordinatePlane* plane2;
39 | // mutable KChart::CartesianAxis xAxis;
40 | //mutable KChart::CartesianAxis yAxis;
41 |
42 | };
43 |
44 |
45 | #endif /* MAINWINDOW_H */
46 |
47 |
--------------------------------------------------------------------------------
/examples/Sql/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(Sql main.cpp)
2 |
3 | target_link_libraries(Sql KChart6 Qt::Widgets Qt::Sql)
4 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(StockDiagram_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(StockDiagram_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(StockDiagram_SRCS
12 | Resources.qrc
13 | )
14 |
15 | add_executable(StockDiagram ${StockDiagram_SRCS})
16 |
17 | target_link_libraries(StockDiagram testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/HLC.csv:
--------------------------------------------------------------------------------
1 | ,"Random Inc.",,,"Company&Co KG",,
2 | January, 42.4, 10.3, 32.0, 70, 50, 60
3 | February, 37.3, 20.0, 25.9, 25, 15, 20
4 | March, 33.7, 20.3, 29.0, 15, 11, 14
5 | April, 53.3, 28.1, 39.0, 70, 50, 55
6 | May, 45.0, 36.4, 41.9, 30, 10, 27
7 | June, 63.3, 41.0, 58.7, 20, 10, 19
8 | July, 68.5, 50.7, 55.3, 9, 25, 25
9 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/OHLC.csv:
--------------------------------------------------------------------------------
1 | ,"Foobar Inc."
2 | January, 20.3, 42.4, 10.3, 32.0
3 | February, 32.0, 37.3, 20.0, 25.9
4 | March, 25.9, 33.7, 20.3, 29.0
5 | April, 29.9, 53.3, 28.1, 39.0
6 | May, 39.0, 45.0, 36.4, 41.9
7 | June, 41.9, 63.3, 41.0, 58.7
8 | July, 58.7, 68.5, 50.7, 55.3
9 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/Resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OHLC.csv
5 |
6 |
7 | HLC.csv
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Stock/Advanced/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | class MainWindow : public QWidget, private Ui::MainWindow
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | MainWindow( QWidget *parent = nullptr );
24 |
25 | private Q_SLOTS:
26 | void on_threeDProperties_toggled( bool checked );
27 | void on_perspectiveDepth_valueChanged( int value );
28 | void on_perspectiveAngle_valueChanged( int value );
29 | void on_useShadowColors_toggled( bool checked );
30 | void on_stockTypeCB_currentIndexChanged( const QString &text );
31 | void chooseColor();
32 |
33 | private:
34 | void initValues();
35 | void applyColor(const QColor &color);
36 |
37 | KChart::Chart *m_chart;
38 | TableModel m_HLCModel;
39 | TableModel m_OHLCModel;
40 |
41 | KChart::StockDiagram m_diagram;
42 | KChart::ThreeDBarAttributes m_threeDBarAttributes;
43 | };
44 |
45 | #endif // MAINWINDOW_H
46 |
--------------------------------------------------------------------------------
/examples/Stock/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 |
--------------------------------------------------------------------------------
/examples/TernaryCharts/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TernaryChartsAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(TernaryChartsAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(TernaryChartsAdvanced ${TernaryChartsAdvanced_SRCS})
12 |
13 | target_link_libraries(TernaryChartsAdvanced KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/TernaryCharts/Advanced/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include "mainwindow.h"
12 |
13 | int main( int argc, char** argv )
14 | {
15 | QApplication app( argc, argv );
16 |
17 | MainWindow mainWindow;
18 | mainWindow.show();
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/examples/TernaryCharts/Advanced/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include
13 | #include
14 |
15 | #include "ui_mainwindow.h"
16 |
17 | namespace KChart {
18 |
19 | class Chart;
20 | class TernaryLineDiagram;
21 | class TernaryPointDiagram;
22 | class TernaryCoordinatePlane;
23 |
24 | }
25 |
26 | class MainWindow : public QDialog,
27 | private Ui::MainWindow
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | explicit MainWindow( QWidget* parent = nullptr );
33 |
34 | private Q_SLOTS:
35 | void indexClicked( const QModelIndex& index );
36 |
37 | private:
38 | void setupModel();
39 |
40 | KChart::Chart* m_chart;
41 | KChart::TernaryPointDiagram* m_diagram;
42 | KChart::TernaryCoordinatePlane* m_ternaryPlane;
43 |
44 | QStandardItemModel m_model;
45 | };
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/examples/TernaryCharts/Advanced/mainwindow.ui:
--------------------------------------------------------------------------------
1 |
2 | MainWindow
3 |
4 |
5 |
6 | 0
7 | 0
8 | 400
9 | 300
10 |
11 |
12 |
13 | Ternary Diagram
14 |
15 |
16 |
17 | 9
18 |
19 |
20 | 6
21 |
22 | -
23 |
24 |
25 | QFrame::StyledPanel
26 |
27 |
28 | QFrame::Raised
29 |
30 |
31 |
32 | -
33 |
34 |
35 | ...
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/examples/TernaryCharts/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 |
--------------------------------------------------------------------------------
/examples/Widget/Advanced/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(WidgetAdvanced_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(WidgetAdvanced_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(WidgetAdvanced ${WidgetAdvanced_SRCS})
12 |
13 | target_link_libraries(WidgetAdvanced KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/examples/Widget/Advanced/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 |
14 | namespace KChart{
15 | class Widget;
16 | }
17 |
18 | class MainWindow : public QWidget, private Ui::MainWindow
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | MainWindow( QWidget* parent = nullptr );
24 |
25 | KChart::Widget* widget;
26 |
27 | public Q_SLOTS:
28 | void changeType();
29 | void changeLeading( int leading );
30 | void addDataset();
31 |
32 | private:
33 | int datasetCount;
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/examples/Widget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Advanced)
2 | add_subdirectory(Parameters)
3 | add_subdirectory(Simple)
4 |
--------------------------------------------------------------------------------
/examples/Widget/Parameters/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(WidgetParameters main.cpp)
2 |
3 | target_link_libraries(WidgetParameters KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Widget/Simple/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(WidgetSimple main.cpp)
2 |
3 | target_link_libraries(WidgetSimple KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/examples/Widget/Simple/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | KChart::Widget widget;
16 | widget.resize( 600, 600 );
17 |
18 | QVector< qreal > vec0, vec1, vec2;
19 |
20 | vec0 << -5 << -4 << -3 << -2 << -1 << 0
21 | << 1 << 2 << 3 << 4 << 5;
22 | vec1 << 25 << 16 << 9 << 4 << 1 << 0
23 | << 1 << 4 << 9 << 16 << 25;
24 | vec2 << -125 << -64 << -27 << -8 << -1 << 0
25 | << 1 << 8 << 27 << 64 << 125;
26 |
27 | widget.setDataset( 0, vec0, "Linear" );
28 | widget.setDataset( 1, vec1, "Quadratic" );
29 | widget.setDataset( 2, vec2, "Cubic" );
30 |
31 | widget.show();
32 |
33 | return app.exec();
34 | }
35 |
--------------------------------------------------------------------------------
/examples/Zoom/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Keyboard)
2 | add_subdirectory(ScrollBars)
3 |
--------------------------------------------------------------------------------
/examples/Zoom/Keyboard/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(ZoomKeyboard_SRCS
2 | zoomwidget.cpp
3 | mainwindow.cpp
4 | zoomwidget.h
5 | mainwindow.h
6 | main.cpp
7 | )
8 |
9 | qt_wrap_ui(ZoomKeyboard_SRCS
10 | mainwindow.ui
11 | )
12 |
13 | add_executable(ZoomKeyboard ${ZoomKeyboard_SRCS})
14 |
15 | target_link_libraries(ZoomKeyboard KChart6 Qt::Widgets)
16 |
--------------------------------------------------------------------------------
/examples/Zoom/Keyboard/mainwindow.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "mainwindow.h"
10 | #include "zoomwidget.h"
11 | #include
12 | #include
13 |
14 | using namespace KChart;
15 |
16 | MainWindow::MainWindow( QWidget* parent )
17 | : QWidget( parent )
18 | {
19 | setupUi( this );
20 |
21 | QHBoxLayout* chartLayout = new QHBoxLayout( chartFrame );
22 | widget = new ZoomWidget( chartFrame );
23 | widget->setGlobalLeadingRight( 10 );
24 | chartLayout->addWidget( widget );
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/examples/Zoom/Keyboard/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 |
14 | namespace KChart{
15 | class Widget;
16 | }
17 |
18 | class MainWindow : public QWidget, private Ui::MainWindow
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | MainWindow( QWidget* parent = nullptr );
24 |
25 | KChart::Widget* widget;
26 |
27 | private:
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/examples/Zoom/Keyboard/mainwindow.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MainWindow
6 |
7 |
8 |
9 | 0
10 | 0
11 | 561
12 | 512
13 |
14 |
15 |
16 | Form
17 |
18 |
19 |
20 | 9
21 |
22 |
23 | 6
24 |
25 | -
26 |
27 |
28 | QFrame::StyledPanel
29 |
30 |
31 | QFrame::Raised
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/examples/Zoom/Keyboard/zoomwidget.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef ZOOMWIDGET_H
10 | #define ZOOMWIDGET_H
11 |
12 | #include
13 |
14 | class ZoomWidget : public KChart::Widget
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | explicit ZoomWidget( QWidget* parent );
20 |
21 | protected:
22 | QPointF findNewZoomCenter( const QPoint & pos );
23 | void mousePressEvent( QMouseEvent * e ) override;
24 | void wheelEvent( QWheelEvent* e ) override;
25 | void keyPressEvent( QKeyEvent* e ) override;
26 | };
27 |
28 |
29 | #endif /* ZOOMWIDGET_H */
30 |
31 |
--------------------------------------------------------------------------------
/examples/Zoom/ScrollBars/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(ZoomScrollBars_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(ZoomScrollBars_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(ZoomScrollBars_SRCS
12 | ZoomScrollBars.qrc
13 | )
14 |
15 | add_executable(ZoomScrollBars ${ZoomScrollBars_SRCS})
16 |
17 | target_link_libraries(ZoomScrollBars testtools KChart6 Qt::Widgets)
18 |
--------------------------------------------------------------------------------
/examples/Zoom/ScrollBars/ZoomScrollBars.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../tools/modeldata/KChart-Test-Linear.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/Zoom/ScrollBars/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Zoom/ScrollBars/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class LineDiagram;
18 | class Legend;
19 | }
20 |
21 | class MainWindow : public QWidget, private Ui::MainWindow
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | MainWindow( QWidget* parent = nullptr );
27 |
28 |
29 |
30 | private Q_SLOTS:
31 | void on_zoomFactorSB_valueChanged( double factor );
32 | void on_adjustGridCB_toggled( bool checked );
33 | void on_rubberBandZoomCB_toggled( bool checked );
34 | void on_hSBar_valueChanged( int value );
35 | void on_vSBar_valueChanged( int value );
36 |
37 | void applyNewZoomParameters();
38 |
39 | private:
40 | KChart::Chart* m_chart;
41 | TableModel m_model;
42 | KChart::LineDiagram* m_lines;
43 | KChart::Legend* m_legend;
44 | };
45 |
46 | #endif /* MAINWINDOW_H */
47 |
--------------------------------------------------------------------------------
/examples/demo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(demo_SRCS
2 | datasetsettings.cpp
3 | gradientdialog.cpp
4 | colorslider.cpp
5 | diagramsettings.cpp
6 | datavaluesettings.cpp
7 | diagramtypedialog.cpp
8 | axissettings.cpp
9 | mainwindow.cpp
10 | datasetsettings.h
11 | gradientdialog.h
12 | colorslider.h
13 | diagramsettings.h
14 | datavaluesettings.h
15 | diagramtypedialog.h
16 | axissettings.h
17 | mainwindow.h
18 | main.cpp
19 | )
20 |
21 | qt_wrap_ui(demo_SRCS
22 | datasetsettings.ui
23 | gradientdialog.ui
24 | diagramsettings.ui
25 | datavaluesettings.ui
26 | diagramtypedialog.ui
27 | axissettings.ui
28 | )
29 |
30 | qt_add_resources(demo_SRCS
31 | demo.qrc
32 | )
33 |
34 | add_executable(demo ${demo_SRCS})
35 |
36 | target_link_libraries(demo testtools KChart6 Qt::Widgets)
37 |
--------------------------------------------------------------------------------
/examples/demo/KChart-Test-Pie.csv:
--------------------------------------------------------------------------------
1 | "Pie","A","B","C","D","E","F"
2 | 1,2.5,1.25,4,1,1,3
3 | 3,4.2,1.43,6,6,3,2
4 |
--------------------------------------------------------------------------------
/examples/demo/axissettings.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef AXISSETTINGS_H
10 | #define AXISSETTINGS_H
11 |
12 | #include
13 |
14 | namespace KChart
15 | {
16 | class Chart;
17 | }
18 |
19 | class AxisSettings : public QWidget
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | explicit AxisSettings( KChart::Chart *chart, QWidget *parent = nullptr );
25 | ~AxisSettings() override;
26 |
27 | public Q_SLOTS:
28 | void diagramTypeChanged();
29 |
30 | private:
31 | class Private;
32 | Private *d;
33 | };
34 |
35 | #endif // AXISSETTINGS_H
36 |
--------------------------------------------------------------------------------
/examples/demo/barSimple.csv:
--------------------------------------------------------------------------------
1 | "BarSimple","A","B","C","D"
2 | 1,0.5,1,0.5,0.7
3 | 2,1,0.5,1.5,0.8
4 | 3,1.5,2,0.7,1
5 | 4,0.7,0.3,1,2
6 | 5,1.3,2,1,0.6
7 | 6,2,1,3,0.5
--------------------------------------------------------------------------------
/examples/demo/datasetsettings.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef DATASETSETTINGS_H
10 | #define DATASETSETTINGS_H
11 |
12 | #include
13 |
14 | namespace KChart{
15 | class Chart;
16 | }
17 |
18 | class DatasetSettings : public QWidget
19 | {
20 | Q_OBJECT
21 | Q_PROPERTY( int datasetCount READ datasetCount WRITE setDatasetCount NOTIFY datasetCountChanged() )
22 |
23 | public:
24 | explicit DatasetSettings( KChart::Chart *chart, QWidget *parent = nullptr );
25 | ~DatasetSettings() override;
26 | int datasetCount() const;
27 | public Q_SLOTS:
28 | void setDatasetCount( int value );
29 | void indexChanged( int index );
30 | void diagramTypeChanged();
31 |
32 | Q_SIGNALS:
33 | void datasetCountChanged();
34 |
35 | private:
36 | class Private;
37 | Private *d;
38 | };
39 |
40 | #endif // DATASETSETTINGS_H
41 |
--------------------------------------------------------------------------------
/examples/demo/datavaluesettings.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef DATAVALUESETTINGS_H
10 | #define DATAVALUESETTINGS_H
11 |
12 | #include
13 |
14 | namespace KChart {
15 | class Chart;
16 | }
17 |
18 | class DataValueSettings : public QWidget
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | DataValueSettings( KChart::Chart *chart, QWidget* parent = nullptr );
24 | ~DataValueSettings() override;
25 |
26 | public Q_SLOTS:
27 | void refresh();
28 |
29 | private:
30 | class Private;
31 | Private *d;
32 |
33 | };
34 |
35 |
36 | #endif /* MAINWINDOW_H */
37 |
38 |
--------------------------------------------------------------------------------
/examples/demo/demo.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | barSimple.csv
4 | lineAnimate.csv
5 | KChart-Test-Pie.csv
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/demo/diagramsettings.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef DIAGRAMSETTINGS_H
10 | #define DIAGRAMSETTINGS_H
11 |
12 | #include
13 |
14 | namespace KChart{
15 | class Chart;
16 | }
17 |
18 | class DiagramSettings : public QWidget
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | explicit DiagramSettings( KChart::Chart* chart, QWidget *parent = nullptr );
24 | ~DiagramSettings() override;
25 |
26 | public Q_SLOTS:
27 | void refreshSettings();
28 |
29 | private:
30 | class Private;
31 | Private *d;
32 | };
33 |
34 | #endif // DIAGRAMSETTINGS_H
35 |
--------------------------------------------------------------------------------
/examples/demo/diagramtypedialog.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef DIAGRAMTYPEDIALOG_H
10 | #define DIAGRAMTYPEDIALOG_H
11 |
12 | #include
13 | #include
14 |
15 | class QAbstractItemModel;
16 | namespace KChart
17 | {
18 | class Chart;
19 | }
20 |
21 | class DiagramTypeDialog : public QDialog
22 | {
23 | Q_OBJECT
24 | public:
25 | enum DiagramType{ Bar, LyingBar, Line, Plotter, Pie };
26 | enum Subtype{ Normal, Percent, Stacked };
27 | explicit DiagramTypeDialog( KChart::Chart *chart, QWidget *parent = nullptr );
28 | ~DiagramTypeDialog() override;
29 |
30 | void setDefaultModels( QHash< DiagramType, QAbstractItemModel* > models );
31 |
32 | Q_SIGNALS:
33 | void diagramTypeChanged( DiagramTypeDialog::DiagramType, DiagramTypeDialog::Subtype );
34 |
35 | private:
36 | class Private;
37 | Private *d;
38 | };
39 |
40 | #endif // DIAGRAMTYPEDIALOG_H
41 |
--------------------------------------------------------------------------------
/examples/demo/gradientdialog.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef GRADIENTDIALOG_H
10 | #define GRADIENTDIALOG_H
11 |
12 | #include
13 | #include
14 |
15 | class GradientDialog : public QDialog
16 | {
17 | Q_OBJECT
18 | Q_PROPERTY( QGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged() )
19 |
20 | public:
21 | explicit GradientDialog( QWidget *parent = nullptr );
22 | ~GradientDialog() override;
23 | QGradient gradient() const;
24 | void setGradient( const QGradient &gradient );
25 | static QGradient getGradient( const QGradient &gradient, QWidget *parent = nullptr, const QString &title = QString() );
26 |
27 | Q_SIGNALS:
28 | void gradientChanged();
29 |
30 | private:
31 | class Private;
32 | Private *d;
33 | };
34 |
35 | #endif // GRADIENTDIALOG_H
36 |
--------------------------------------------------------------------------------
/examples/demo/lineAnimate.csv:
--------------------------------------------------------------------------------
1 | "LineAnimate","A","B","C","D"
2 | 1, 29.5 , 30 , 29.5 , 29.7
3 | 2, 30 , 29.5, 30.5 , 29.8
4 | 3, 30.5 , 31 , 29.7 , 30
5 | 4, 29.7 , 29.3, 30 , 31
6 | 5, 30.3 , 31 , 30 , 29.6
7 | 6, 29.4 , 30 , 34 , 29.5
8 |
--------------------------------------------------------------------------------
/examples/demo/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include
13 |
14 | class MainWindow : public QMainWindow
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit MainWindow( QWidget *parent = nullptr );
19 | ~MainWindow() override;
20 |
21 |
22 | private:
23 | class Private;
24 | Private *d;
25 |
26 | };
27 |
28 | #endif // MAINWINDOW_H
29 |
--------------------------------------------------------------------------------
/examples/tools/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set( testtools_LIB_SRCS
2 | TableModel.cpp
3 | TableModel.h
4 | )
5 |
6 | add_library(testtools SHARED ${testtools_LIB_SRCS})
7 |
8 | generate_export_header( testtools )
9 |
10 | target_link_libraries(testtools LINK_PRIVATE
11 | Qt::Core
12 | )
13 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test-Datatables.csv:
--------------------------------------------------------------------------------
1 | ,"Mondays","Tuesdays","Wednesdays","Thursdays","Fridays","Saturdays","Sundays"
2 | 1,38.7,36.5,36.9,35.5,39.1,34.5,36.5
3 | 2,38.9,37.2,35.8,36,38.9,34.6,36.4
4 | 3,39.1,36.8,37.4,36.2,38.7,34.7,36.6
5 | 4,38.9,35.9,37.2,35.8,38.9,38.5,36.5
6 | 5,39,37.5,37,35.9,39.1,35.6,35.7
7 | 6,37.9,38.2,37.9,36.3,38.9,36.4,36.4
8 | 7,38.5,37.8,36.8,36.2,38.7,35.5,36.5
9 | 8,39.7,36.9,38.4,36.5,40.1,35.6,36.8
10 | 9,39.9,38.5,38.2,37,39.9,35.7,37.5
11 | 10,40.1,39.2,38,37.2,39.7,39.5,37.4
12 | 11,39.9,38.8,38.9,36.8,39.9,36.6,37.6
13 | 12,40,37.9,37.8,36.9,40.1,37.4,37.5
14 | 13,38.9,39.5,39.4,37.3,39.9,36.5,36.7
15 | 14,39.5,40.2,39.2,37.2,39.7,36.6,37.4
16 | 15,40.7,39.8,39,37.5,41.1,36.7,37.5
17 | 16,40.9,38.9,39.9,38,40.9,40.5,37.8
18 | 17,41.1,40.5,38.8,38.2,40.7,37.6,38.5
19 | 18,40.9,41.2,40.4,37.8,40.9,38.4,38.4
20 | 19,41,40.8,40.2,37.9,41.1,37.5,38.6
21 | 20,39.9,39.9,40,38.3,40.9,37.6,38.5
22 | 21,40.5,41.5,40.9,38.2,40.7,37.7,37.7
23 | 22,41.7,42.2,39.8,38.5,42.1,41.5,38.4
24 | 23,41.9,41.8,41.4,39,41.9,38.6,38.5
25 | 24,42.1,40.9,41.2,39.2,41.7,39.4,38.8
26 | 25,41.9,42.5,41,38.8,41.9,38.5,39.5
27 | 26,42,43.2,41.9,38.9,42.1,38.6,39.4
28 | 27,40.9,42.8,40.8,39.3,41.9,38.7,39.6
29 | 28,41.5,41.9,42.4,39.2,41.7,42.5,39.5
30 | 29,42.7,43.5,42.2,39.5,43.1,39.6,38.7
31 | 30,42.9,44.2,42,40,42.9,40.4,39.4
32 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test-Empty.csv:
--------------------------------------------------------------------------------
1 | ,"Mondays","Tuesdays","Wednesdays","Thursdays","Fridays","Saturdays","Sundays"
2 | 1,0.0,0.0,0.0,0.0,0.0,0.0,0.0
3 | 2,0.0,0.0,0.0,0.0,0.0,0.0,0.0
4 | 3,0.0,0.0,0.0,0.0,0.0,0.0,0.0
5 | 4,0.0,0.0,0.0,0.0,0.0,0.0,0.0
6 | 5,0.0,0.0,0.0,0.0,0.0,0.0,0.0
7 | 6,0.0,0.0,0.0,0.0,0.0,0.0,0.0
8 | 7,0.0,0.0,0.0,0.0,0.0,0.0,0.0
9 | 8,0.0,0.0,0.0,0.0,0.0,0.0,0.0
10 | 9,0.0,0.0,0.0,0.0,0.0,0.0,0.0
11 | 10,0.0,0.0,0.0,0.0,0.0,0.0,0.0
12 |
13 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test-Linear.csv:
--------------------------------------------------------------------------------
1 | "Linear","A","B","C","D","E"
2 | 1,-0.5,-0.25,-4,-3,0
3 | 2,-1,-0.5,-4.1,-2.9,-0.1
4 | 3,-1.5,-0.75,-4.2,-2.8,-0.2
5 | 4,2,1,5,2.7,0.3
6 | 5,2.5,1.25,5.1,2.6,0.4
7 | 6,3,1.5,5.2,2.5,0.5
8 | 7,3.5,1.75,6,2.4,0.6
9 | 8,4,2,6.1,2.3,0.7
10 | 9,4.5,-2.25,6.2,2.2,0.8
11 | 10,5,2.5,-7,2.1,0.9
12 | 11,5.5,-2.75,7.1,2,1
13 | 12,6,3,-7.2,1.9,1.1
14 | 13,6.5,-3.25,8,1.8,1.2
15 | 14,7,-3.5,8.1,1.7,1.3
16 | 15,7.5,-3.75,8.2,1.6,1.4
17 | 16,8,4,-9,1.5,1.5
18 | 17,8.5,4.25,9.1,1.4,1.6
19 | 18,9,4.5,9.2,1.3,1.7
20 | 19,9.5,4.75,10,1.2,1.8
21 | 20,10,5,10.1,1.1,1.9
22 | 21,10.5,5.25,10.2,1.0,2
23 | 22,11,5.5,11,0.9,2.1
24 | 23,11.5,5.75,11.1,0.8,2.2
25 | 24,12,6,11.2,0.7,2.3
26 | 25,12.5,6.25,12,0.6,2.4
27 | 26,13,6.5,12.1,0.5,2.5
28 | 27,13.5,6.75,12.2,0.4,2.6
29 | 28,14,7,13,0.3,2.7
30 | 29,14.5,7.25,13.1,0.2,2.8
31 | 30,15,7.5,13.2,0.1,2.9
32 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test-Linear_1_dataset.csv:
--------------------------------------------------------------------------------
1 | "Linear","A"
2 | 0,-1.5
3 | 1, 0.1
4 | 2,-0.05
5 | 3,-0.025
6 | 4,0.0275
7 | 5,0.02
8 | 6,-0.01
9 | 7,0.1
10 | 8,0.4
11 | 9,0.4
12 | 10,0.4
13 | 11,0.4
14 | 12,0.4
15 | 13,0.4
16 | 14,0.4
17 | 15,0.4
18 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test-Pie.csv:
--------------------------------------------------------------------------------
1 | "Pie","A","B","C","D","E","F"
2 | 1,2.5,1.25,4,1,1,3
3 | 3,4.2,1.43,6,6,3,2
4 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test_Linear_One_Column.csv:
--------------------------------------------------------------------------------
1 | "Linear - One Column","Increasing"
2 | 1,0
3 | 2,1
4 | 3,2
5 | 4,3
6 | 5,4
7 | 6,5
8 | 7,6
9 | 8,7
10 | 9,8
11 | 10,9
12 | 11,10
13 | 12,11
14 | 13,12
15 | 14,13
16 | 15,14
17 | 16,15
18 | 17,16
19 | 18,17
20 | 19,18
21 | 20,19
22 | 21,20
23 | 22,21
24 | 23,22
25 | 24,23
26 | 25,24
27 | 26,25
28 | 27,26
29 | 28,27
30 | 29,28
31 | 30,29
32 | 31,30
33 | 32,31
34 | 33,32
35 | 34,33
36 | 35,34
37 | 36,35
38 | 37,36
39 | 38,37
40 | 39,38
41 | 40,39
42 | 41,40
43 | 42,41
44 | 43,42
45 | 44,43
46 | 45,44
47 | 46,45
48 | 47,46
49 | 48,47
50 | 49,48
51 | 50,49
52 |
--------------------------------------------------------------------------------
/examples/tools/modeldata/KChart-Test_Linear_Two_Columns.csv:
--------------------------------------------------------------------------------
1 | "Linear - Two Columns","Increasing","Decreasing"
2 | 1,0,49
3 | 2,1,48
4 | 3,2,47
5 | 4,3,46
6 | 5,4,45
7 | 6,5,44
8 | 7,6,43
9 | 8,7,42
10 | 9,8,41
11 | 10,9,40
12 | 11,10,39
13 | 12,11,38
14 | 13,12,37
15 | 14,13,36
16 | 15,14,35
17 | 16,15,34
18 | 17,16,33
19 | 18,17,32
20 | 19,18,31
21 | 20,19,30
22 | 21,20,29
23 | 22,21,28
24 | 23,22,27
25 | 24,23,26
26 | 25,24,25
27 | 26,25,24
28 | 27,26,23
29 | 28,27,22
30 | 29,28,21
31 | 30,29,20
32 | 31,30,19
33 | 32,31,18
34 | 33,32,17
35 | 34,33,16
36 | 35,34,15
37 | 36,35,14
38 | 37,36,13
39 | 38,37,12
40 | 39,38,11
41 | 40,39,10
42 | 41,40,9
43 | 42,41,8
44 | 43,42,7
45 | 44,43,6
46 | 45,44,5
47 | 46,45,4
48 | 47,46,3
49 | 48,47,2
50 | 49,48,1
51 | 50,49,0
52 |
--------------------------------------------------------------------------------
/images/polar-plane-start-position.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/kdiagram/6cb22b406cd7b91acdd465307e6a6e4c72b78190/images/polar-plane-start-position.png
--------------------------------------------------------------------------------
/images/position-alignments.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/kdiagram/6cb22b406cd7b91acdd465307e6a6e4c72b78190/images/position-alignments.png
--------------------------------------------------------------------------------
/qtests/AttributesModel/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestKChartAttributesModel_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestKChartAttributesModel_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestKChartAttributesModel_SRCS}
11 | TEST_NAME TestKChartAttributesModel
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/AttributesModel/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/AxisOwnership/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestKChartAxisOwnership_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestKChartAxisOwnership_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestKChartAxisOwnership_SRCS}
11 | TEST_NAME TestKChartAxisOwnership
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/AxisOwnership/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/BarDiagrams/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestKChartBarDiagrams_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestKChartBarDiagrams_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestKChartBarDiagrams_SRCS}
11 | TEST_NAME TestKChartBarDiagrams
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/BarDiagrams/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | include_directories(
3 | ${CMAKE_SOURCE_DIR}/examples/tools
4 | ${CMAKE_BINARY_DIR}/examples/tools
5 | ${CMAKE_SOURCE_DIR}/src/KChart
6 | ${CMAKE_SOURCE_DIR}/src/KChart/include
7 | ${CMAKE_SOURCE_DIR}/src/KChart/Cartesian
8 | ${CMAKE_SOURCE_DIR}/src/KChart/Cartesian/DiagramFlavors
9 | ${CMAKE_SOURCE_DIR}/src/KChart/Polar
10 | ${CMAKE_SOURCE_DIR}/src/KChart/Ternary
11 | )
12 | remove_definitions(
13 | -DQT_NO_KEYWORDS
14 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS
15 | -DQT_NO_CAST_FROM_ASCII
16 | )
17 |
18 | add_subdirectory( AttributesModel )
19 | add_subdirectory( AxisOwnership )
20 | add_subdirectory( BarDiagrams )
21 | add_subdirectory( CartesianDiagramDataCompressor )
22 | add_subdirectory( CartesianPlanes )
23 | add_subdirectory( ChartElementOwnership )
24 | add_subdirectory( Cloning )
25 | add_subdirectory( DrawIntoPainter )
26 | add_subdirectory( Legends )
27 | add_subdirectory( LineDiagrams )
28 | add_subdirectory( Measure )
29 | add_subdirectory( Palette )
30 | add_subdirectory( ParamVsParam )
31 | add_subdirectory( PieDiagrams )
32 | add_subdirectory( PolarDiagrams )
33 | add_subdirectory( PolarPlanes )
34 | add_subdirectory( QLayout )
35 | add_subdirectory( RelativePosition )
36 | add_subdirectory( WidgetElementOwnership )
37 |
--------------------------------------------------------------------------------
/qtests/CartesianDiagramDataCompressor/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | CartesianDiagramDataCompressorTests.cpp
3 | TEST_NAME CartesianDiagramDataCompressorTests
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/CartesianPlanes/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestCartesianPlanes_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestCartesianPlanes_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestCartesianPlanes_SRCS}
11 | TEST_NAME TestCartesianPlanes
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/CartesianPlanes/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/ChartElementOwnership/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestChartElementOwnership
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/Cloning/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestCloning
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/DrawIntoPainter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestDrawIntoPainter_SRCS
2 | framewidget.cpp
3 | mainwindow.cpp
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(TestDrawIntoPainter_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | qt_add_resources(TestDrawIntoPainter_SRCS
12 | DrawIntoPainter.qrc
13 | )
14 |
15 | ecm_add_test(
16 | ${TestDrawIntoPainter_SRCS}
17 | TEST_NAME TestDrawIntoPainter
18 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
19 | )
20 |
21 | set_property(TEST TestDrawIntoPainter PROPERTY TIMEOUT 600)
22 |
--------------------------------------------------------------------------------
/qtests/DrawIntoPainter/DrawIntoPainter.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Linear.csv
5 | data_test.csv
6 | data_test_small.csv
7 | data_empty.csv
8 |
9 |
10 |
--------------------------------------------------------------------------------
/qtests/DrawIntoPainter/data_empty.csv:
--------------------------------------------------------------------------------
1 | Linear,A,B,C,D,E
2 | 0,0,0,0,0,0
3 |
--------------------------------------------------------------------------------
/qtests/DrawIntoPainter/framewidget.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef FRAMEWIDGET_H
10 | #define FRAMEWIDGET_H
11 |
12 | #include
13 |
14 | namespace KChart {
15 | class Chart;
16 | }
17 |
18 |
19 | class FrameWidget : public QWidget
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | explicit FrameWidget( QWidget * parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
25 |
26 | void paintEvent( QPaintEvent* ) override;
27 |
28 | void setChart( KChart::Chart* chart );
29 |
30 | private:
31 | KChart::Chart* mChart;
32 | };
33 |
34 |
35 | #endif /* FRAMEWIDGET_H */
36 |
37 |
--------------------------------------------------------------------------------
/qtests/DrawIntoPainter/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "mainwindow.h"
10 |
11 | #include
12 |
13 | class TestDrawIntoPainter: public QObject {
14 | Q_OBJECT
15 | private Q_SLOTS:
16 |
17 | void initTestCase()
18 | {
19 | qputenv("QTEST_FUNCTION_TIMEOUT", QByteArray("600000"));
20 | }
21 |
22 | void testOriginal()
23 | {
24 | mainWindow.updateData(QStringLiteral(":/original"));
25 | }
26 |
27 | void testTest()
28 | {
29 | // The test in :/test is so large it times out on CI
30 | // so we run the half sized :/test4000 for now
31 | #if 0
32 | mainWindow.updateData(QStringLiteral(":/test"));
33 | #else
34 | mainWindow.updateData(QStringLiteral(":/test_small"));
35 | #endif
36 | }
37 |
38 | private:
39 | MainWindow mainWindow;
40 |
41 | };
42 |
43 | QTEST_MAIN(TestDrawIntoPainter)
44 |
45 | #include "main.moc"
46 |
--------------------------------------------------------------------------------
/qtests/Legends/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestLegends
4 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/LineDiagrams/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestLineDiagrams_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestLineDiagrams_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestLineDiagrams_SRCS}
11 | TEST_NAME TestLineDiagrams
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/LineDiagrams/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/Measure/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestMeasure_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestMeasure_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestMeasure_SRCS}
11 | TEST_NAME TestMeasure
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/Measure/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/Palette/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestKChartPalette
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/ParamVsParam/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestParamVsParam_SRCS
2 | ModelParamVsParam.cpp
3 | ModelParamVsParamPlot.cpp
4 | mainwindow.cpp
5 | main.cpp
6 | )
7 |
8 | ecm_add_test(
9 | ${TestParamVsParam_SRCS}
10 | TEST_NAME TestParamVsParam
11 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
12 | )
13 |
--------------------------------------------------------------------------------
/qtests/ParamVsParam/ModelParamVsParam.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef SUMGUI_MODELPARAMVSPARAM_H
10 | #define SUMGUI_MODELPARAMVSPARAM_H
11 |
12 |
13 | #include
14 | #include
15 |
16 |
17 | class ModelParamVsParam: public QStandardItemModel
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | ModelParamVsParam(
23 | QObject *p_parent = nullptr);
24 |
25 | void setTimeout(
26 | int p_timeout);
27 |
28 | void startSampling();
29 |
30 | void stopSampling();
31 |
32 | void populate(
33 | int p_nrOfParameters = 8,
34 | int p_nrOfSamples = 100);
35 |
36 | private Q_SLOTS:
37 | void timeout();
38 |
39 | private:
40 | QTimer m_timer;
41 | }; // class ModelParamVsParam
42 |
43 |
44 | #endif // SUMGUI_MODELPARAMVSPARAM_H
45 |
--------------------------------------------------------------------------------
/qtests/ParamVsParam/ModelParamVsParamPlot.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef SUMGUI_MODELPARAMVSPARAMPLOT_H
10 | #define SUMGUI_MODELPARAMVSPARAMPLOT_H
11 |
12 |
13 | #include
14 |
15 |
16 | class ModelParamVsParamPlot: public QSortFilterProxyModel
17 | {
18 | public:
19 | ModelParamVsParamPlot(
20 | QAbstractItemModel *p_sourceModel,
21 | int p_column1,
22 | int p_column2,
23 | QObject *p_parent = nullptr);
24 |
25 | int columnCount(
26 | const QModelIndex &p_parent = QModelIndex()) const override;
27 |
28 | protected:
29 | QVariant data(
30 | const QModelIndex &p_index,
31 | int p_role = Qt::DisplayRole) const override;
32 |
33 | bool filterAcceptsColumn(
34 | int p_source_column,
35 | const QModelIndex &p_source_parent) const override;
36 |
37 | private:
38 | int m_column1;
39 | int m_column2;
40 | }; // class ModelParamVsParamPlot
41 |
42 |
43 | #endif // SUMGUI_MODELPARAMVSPARAMPLOT_H
44 |
--------------------------------------------------------------------------------
/qtests/ParamVsParam/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "mainwindow.h"
10 | #include
11 | #include
12 |
13 | class TestParamVsParam: public QObject {
14 | Q_OBJECT
15 | private Q_SLOTS:
16 |
17 | void testMainWindow()
18 | {
19 | QElapsedTimer t;
20 | t.start();
21 |
22 | MainWindow mainWindow;
23 |
24 | qDebug("time constructor: %lld ms", t.elapsed());
25 |
26 | mainWindow.show();
27 | QTimer::singleShot(0, qApp, SLOT(quit()));
28 |
29 | qDebug("time show(): %lld ms", t.elapsed());
30 | // uncomment to see it blink:
31 | // QTest::qWait( 10000 );
32 |
33 | }
34 | };
35 |
36 | QTEST_MAIN(TestParamVsParam)
37 |
38 | #include "main.moc"
39 |
--------------------------------------------------------------------------------
/qtests/ParamVsParam/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 |
13 | #include
14 |
15 |
16 | class ModelParamVsParam;
17 |
18 | class QGridLayout;
19 | class QLineEdit;
20 |
21 | namespace KChart
22 | {
23 | class LineDiagram;
24 | }
25 |
26 |
27 | class MainWindow: public QWidget
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | MainWindow(
33 | QWidget *p_parent = nullptr);
34 |
35 | ~MainWindow() override;
36 |
37 | private Q_SLOTS:
38 | void timeoutEditingFinished();
39 | void editingFinished();
40 |
41 | private:
42 | void addPlots();
43 | void removePlots();
44 | void setMarkerAttributes(
45 | KChart::LineDiagram *p_lineDiagram);
46 |
47 | private:
48 | ModelParamVsParam *m_sourceModel;
49 | QLineEdit *m_timeoutLineEdit;
50 | QLineEdit *m_nrOfParametersLineEdit;
51 | QLineEdit *m_nrOfSamplesLineEdit;
52 | QGridLayout *m_paramVsParamGridLayout;
53 | }; // class MainWindow
54 |
55 |
56 | #endif // MAINWINDOW_H
57 |
--------------------------------------------------------------------------------
/qtests/PieDiagrams/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestPieDiagrams_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestPieDiagrams_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestPieDiagrams_SRCS}
11 | TEST_NAME TestPieDiagrams
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/PieDiagrams/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/PolarDiagrams/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestPolarDiagrams_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestPolarDiagrams_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestPolarDiagrams_SRCS}
11 | TEST_NAME TestPolarDiagrams
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/PolarDiagrams/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/PolarPlanes/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestPolarPlanes_SRCS
2 | main.cpp
3 | )
4 |
5 | qt_add_resources(TestPolarPlanes_SRCS
6 | Data.qrc
7 | )
8 |
9 | ecm_add_test(
10 | ${TestPolarPlanes_SRCS}
11 | TEST_NAME TestPolarPlanes
12 | LINK_LIBRARIES testtools KChart6 Qt::Widgets Qt::Test
13 | )
14 |
--------------------------------------------------------------------------------
/qtests/PolarPlanes/Data.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ../../examples/tools/modeldata/KChart-Test-Datatables.csv
5 |
6 |
7 |
--------------------------------------------------------------------------------
/qtests/QLayout/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestQLayout
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/RelativePosition/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestRelativePosition
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/qtests/WidgetElementOwnership/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ecm_add_test(
2 | main.cpp
3 | TEST_NAME TestWidgetElementOwnership
4 | LINK_LIBRARIES KChart6 Qt::Widgets Qt::Test
5 | )
6 |
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include(ECMOptionalAddSubdirectory)
2 | ecm_optional_add_subdirectory( KChart )
3 | ecm_optional_add_subdirectory( KGantt )
4 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartNormalBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTNORMALBARDIAGRAM_P_H
10 | #define KCHARTNORMALBARDIAGRAM_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 | #include "KChartBarDiagram_p.h"
23 |
24 | namespace KChart {
25 |
26 | class NormalBarDiagram : public BarDiagram::BarDiagramType
27 | {
28 | public:
29 | explicit NormalBarDiagram( BarDiagram* );
30 | ~NormalBarDiagram() override {}
31 | BarDiagram::BarType type() const override;
32 | const QPair calculateDataBoundaries() const override;
33 | void paint( PaintContext* ctx ) override;
34 | };
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartNormalLineDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTNORMALLINEDIAGRAM_P_H
10 | #define KCHARTNORMALLINEDIAGRAM_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 | #include "KChartLineDiagram_p.h"
23 |
24 | namespace KChart {
25 |
26 | class NormalLineDiagram : public LineDiagram::LineDiagramType
27 | {
28 | public:
29 | explicit NormalLineDiagram( LineDiagram* );
30 | ~NormalLineDiagram() override {}
31 | LineDiagram::LineType type() const override;
32 | const QPair calculateDataBoundaries() const override;
33 | void paint( PaintContext* ctx ) override;
34 | };
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartNormalLyingBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTNORMALLYINGBARDIAGRAM_P_H
10 | #define KCHARTNORMALLYINGBARDIAGRAM_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 | #include "KChartBarDiagram_p.h"
23 |
24 | namespace KChart {
25 |
26 | class NormalLyingBarDiagram : public BarDiagram::BarDiagramType
27 | {
28 | public:
29 | explicit NormalLyingBarDiagram( BarDiagram* );
30 | ~NormalLyingBarDiagram() override {}
31 | BarDiagram::BarType type() const override;
32 | const QPair calculateDataBoundaries() const override;
33 | void paint( PaintContext* ctx ) override;
34 | };
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartNormalPlotter_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTNORMALPLOTTER_P_H
10 | #define KCHARTNORMALPLOTTER_P_H
11 |
12 |
13 | //
14 | // W A R N I N G
15 | // -------------
16 | //
17 | // This file is not part of the KD Chart API. It exists purely as an
18 | // implementation detail. This header file may change from version to
19 | // version without notice, or even be removed.
20 | //
21 | // We mean it.
22 | //
23 | #include "KChartPlotter_p.h"
24 |
25 | namespace KChart {
26 |
27 | class NormalPlotter : public Plotter::PlotterType
28 | {
29 | public:
30 | explicit NormalPlotter( Plotter* );
31 | ~NormalPlotter() override {}
32 | Plotter::PlotType type() const override;
33 | const QPair< QPointF, QPointF > calculateDataBoundaries() const override;
34 | void paint( PaintContext* ctx ) override;
35 | };
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartPercentBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTPERCENTBARDIAGRAM_P_H
10 | #define KCHARTPERCENTBARDIAGRAM_P_H
11 |
12 |
13 | #include "KChartBarDiagram_p.h"
14 |
15 | namespace KChart {
16 |
17 | class PercentBarDiagram : public BarDiagram::BarDiagramType
18 | {
19 | public:
20 | explicit PercentBarDiagram( BarDiagram* );
21 | ~PercentBarDiagram() override {}
22 | BarDiagram::BarType type() const override;
23 | const QPair calculateDataBoundaries() const override;
24 | void paint( PaintContext* ctx ) override;
25 | };
26 |
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartPercentLineDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTPERCENTLINEDIAGRAM_P_H
10 | #define KCHARTPERCENTLINEDIAGRAM_P_H
11 |
12 | #include "KChartLineDiagram_p.h"
13 |
14 | namespace KChart {
15 |
16 | class PercentLineDiagram : public LineDiagram::LineDiagramType
17 | {
18 | public:
19 | explicit PercentLineDiagram( LineDiagram* );
20 | ~PercentLineDiagram() override {}
21 | LineDiagram::LineType type() const override;
22 | const QPair calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartPercentLyingBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTPERCENTLYINGBARDIAGRAM_P_H
10 | #define KCHARTPERCENTLYINGBARDIAGRAM_P_H
11 |
12 | #include "KChartBarDiagram_p.h"
13 |
14 | namespace KChart {
15 |
16 | class PercentLyingBarDiagram : public BarDiagram::BarDiagramType
17 | {
18 | public:
19 | explicit PercentLyingBarDiagram( BarDiagram* );
20 | ~PercentLyingBarDiagram() override {}
21 | BarDiagram::BarType type() const override;
22 | const QPair calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartPercentPlotter_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTPERCENTPLOTTER_P_H
10 | #define KCHARTPERCENTPLOTTER_P_H
11 |
12 | #include "KChartPlotter_p.h"
13 |
14 | namespace KChart {
15 |
16 | class PercentPlotter : public Plotter::PlotterType
17 | {
18 | public:
19 | explicit PercentPlotter( Plotter* );
20 | ~PercentPlotter() override {}
21 | Plotter::PlotType type() const override;
22 | const QPair< QPointF, QPointF > calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartStackedBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTSTACKEDBARDIAGRAM_P_H
10 | #define KCHARTSTACKEDBARDIAGRAM_P_H
11 |
12 | #include "KChartBarDiagram_p.h"
13 |
14 | namespace KChart {
15 |
16 | class StackedBarDiagram : public BarDiagram::BarDiagramType
17 | {
18 | public:
19 | explicit StackedBarDiagram( BarDiagram* );
20 | ~StackedBarDiagram() override {}
21 | BarDiagram::BarType type() const override;
22 | const QPair calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartStackedLineDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTSTACKEDLINEDIAGRAM_P_H
10 | #define KCHARTSTACKEDLINEDIAGRAM_P_H
11 |
12 | #include "KChartLineDiagram_p.h"
13 |
14 | namespace KChart {
15 |
16 | class StackedLineDiagram : public LineDiagram::LineDiagramType
17 | {
18 | public:
19 | explicit StackedLineDiagram( LineDiagram* );
20 | ~StackedLineDiagram() override {}
21 | LineDiagram::LineType type() const override;
22 | const QPair calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/DiagramFlavors/KChartStackedLyingBarDiagram_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTSTACKEDLYINGBARDIAGRAM_P_H
10 | #define KCHARTSTACKEDLYINGBARDIAGRAM_P_H
11 |
12 | #include "KChartBarDiagram_p.h"
13 |
14 | namespace KChart {
15 |
16 | class StackedLyingBarDiagram : public BarDiagram::BarDiagramType
17 | {
18 | public:
19 | explicit StackedLyingBarDiagram( BarDiagram* );
20 | ~StackedLyingBarDiagram() override {}
21 | BarDiagram::BarType type() const override;
22 | const QPair calculateDataBoundaries() const override;
23 | void paint( PaintContext* ctx ) override;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/src/KChart/Cartesian/KChartThreeDBarAttributes_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTTHREEDBARATTRIBUTES_P_H
10 | #define KCHARTTHREEDBARATTRIBUTES_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 | #include
25 |
26 | #include "KChartMath_p.h"
27 |
28 |
29 | namespace KChart {
30 |
31 | /**
32 | * \internal
33 | */
34 | class Q_DECL_HIDDEN ThreeDBarAttributes::Private : public AbstractThreeDAttributes::Private
35 | {
36 | friend class ThreeDBarAttributes;
37 | public:
38 | Private();
39 |
40 | private:
41 | bool useShadowColors;
42 | uint angle;
43 | };
44 |
45 | KCHART_DERIVED_PRIVATE_FOOTER(ThreeDBarAttributes, AbstractThreeDAttributes)
46 |
47 | }
48 |
49 |
50 | #endif // KCHARTTHREEDBARATTRIBUTES_P_H
51 |
--------------------------------------------------------------------------------
/src/KChart/ChartGraphicsItem.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "ChartGraphicsItem.h"
10 |
11 | using namespace KChart;
12 |
13 | ChartGraphicsItem::ChartGraphicsItem()
14 | : QGraphicsPolygonItem()
15 | , m_row( -1 )
16 | , m_column( -1 )
17 | {
18 | }
19 |
20 | ChartGraphicsItem::ChartGraphicsItem( int row, int column )
21 | : QGraphicsPolygonItem()
22 | , m_row( row )
23 | , m_column( column )
24 | {
25 | }
26 |
--------------------------------------------------------------------------------
/src/KChart/ChartGraphicsItem.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef CHARTGRAPHICSITEM_H
10 | #define CHARTGRAPHICSITEM_H
11 |
12 | #include
13 |
14 | namespace KChart {
15 |
16 | /**
17 | * @brief Graphics item used inside of the ReverseMapper
18 | * \internal
19 | */
20 | class ChartGraphicsItem : public QGraphicsPolygonItem
21 | {
22 | public:
23 | enum { Type = UserType + 1 };
24 |
25 | ChartGraphicsItem();
26 |
27 | ChartGraphicsItem( int row, int column );
28 |
29 | int row() const { return m_row; }
30 | int column() const { return m_column; }
31 | int type() const override { return Type; }
32 |
33 | private:
34 | int m_row;
35 | int m_column;
36 | };
37 |
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/src/KChart/KChart6Config.cmake.in:
--------------------------------------------------------------------------------
1 | @PACKAGE_INIT@
2 |
3 | include(CMakeFindDependencyMacro)
4 | find_dependency(Qt6Core @QT_REQUIRED_VERSION@)
5 | find_dependency(Qt6Svg @QT_REQUIRED_VERSION@)
6 | find_dependency(Qt6Widgets @QT_REQUIRED_VERSION@)
7 |
8 | include("${CMAKE_CURRENT_LIST_DIR}/KChart6Targets.cmake")
9 | @PACKAGE_INCLUDE_QCHTARGETS@
10 |
--------------------------------------------------------------------------------
/src/KChart/KChartAbstractThreeDAttributes_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTABSTRACTTHREEDATTRIBUTES_P_H
10 | #define KCHARTABSTRACTTHREEDATTRIBUTES_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 |
25 | #include "KChartMath_p.h"
26 |
27 |
28 | namespace KChart {
29 |
30 | /**
31 | * \internal
32 | */
33 | class Q_DECL_HIDDEN AbstractThreeDAttributes::Private
34 | {
35 | friend class AbstractThreeDAttributes;
36 | public:
37 | Private();
38 | virtual ~Private();
39 |
40 | private:
41 | bool enabled;
42 | // FIXME: What is this needed for? height is not referenced anywhere.
43 | // int height;
44 | qreal depth;
45 | bool threeDBrushEnabled;
46 | };
47 |
48 | inline AbstractThreeDAttributes::AbstractThreeDAttributes( Private * p ) : _d( p ) { init(); }
49 |
50 | }
51 |
52 | #endif // KCHARTABSTRACTTHREEDATTRIBUTES_P_H
53 |
--------------------------------------------------------------------------------
/src/KChart/KChartPaintContext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef PAINTCONTEXT_H
10 | #define PAINTCONTEXT_H
11 |
12 | #include
13 | #include "KChartGlobal.h"
14 |
15 | QT_BEGIN_NAMESPACE
16 | class QPainter;
17 | QT_END_NAMESPACE
18 |
19 | namespace KChart {
20 |
21 | class AbstractCoordinatePlane;
22 |
23 | /**
24 | * @brief Stores information about painting diagrams
25 | * \internal
26 | */
27 | class KCHART_EXPORT PaintContext
28 | {
29 | public:
30 | PaintContext();
31 | ~PaintContext();
32 |
33 | const QRectF rectangle () const;
34 | void setRectangle( const QRectF& rect );
35 |
36 | QPainter* painter() const;
37 | void setPainter( QPainter* painter );
38 |
39 | AbstractCoordinatePlane* coordinatePlane() const;
40 | void setCoordinatePlane( AbstractCoordinatePlane* plane );
41 |
42 | private:
43 | class Private;
44 | Private * _d;
45 | Private * d_func() { return _d; }
46 | const Private * d_func() const { return _d; }
47 | };
48 |
49 | }
50 |
51 | #endif /* PAINTCONTEXT_H */
52 |
53 |
--------------------------------------------------------------------------------
/src/KChart/KChartPrintingParameters.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "KChartPrintingParameters.h"
10 |
11 | using namespace KChart;
12 |
13 | PrintingParameters::PrintingParameters()
14 | : m_scaleFactor( 1.0 )
15 | {
16 | }
17 |
18 | PrintingParameters* PrintingParameters::instance()
19 | {
20 | static PrintingParameters instance;
21 | return &instance;
22 | }
23 |
24 | qreal PrintingParameters::scaleFactor()
25 | {
26 | return instance()->m_scaleFactor;
27 | }
28 |
29 | void PrintingParameters::setScaleFactor( const qreal scaleFactor )
30 | {
31 | instance()->m_scaleFactor = scaleFactor;
32 | }
33 |
34 | void PrintingParameters::resetScaleFactor()
35 | {
36 | instance()->m_scaleFactor = 1.0;
37 | }
38 |
39 | QPen PrintingParameters::scalePen( const QPen& pen )
40 | {
41 | if ( instance()->m_scaleFactor == 1.0 )
42 | return pen;
43 |
44 | QPen resultPen = pen;
45 | resultPen.setWidthF( resultPen.widthF() * instance()->m_scaleFactor );
46 | if ( resultPen.widthF() == 0.0 )
47 | resultPen.setWidthF( instance()->m_scaleFactor );
48 |
49 | return resultPen;
50 | }
51 |
--------------------------------------------------------------------------------
/src/KChart/KChartPrintingParameters.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef PRINTINGPARAMETERS_H
10 | #define PRINTINGPARAMETERS_H
11 |
12 | #include
13 | #include
14 |
15 | //
16 | // W A R N I N G
17 | // -------------
18 | //
19 | // This file is not part of the KD Chart API. It exists purely as an
20 | // implementation detail. This header file may change from version to
21 | // version without notice, or even be removed.
22 | //
23 | // We mean it.
24 | //
25 |
26 | namespace KChart {
27 | /**
28 | * PrintingParameters stores the scale factor which lines has to been scaled with when printing.
29 | * It's essentially printer's logical DPI / widget's logical DPI
30 | * \internal
31 | */
32 | class PrintingParameters {
33 | public:
34 | static qreal scaleFactor();
35 | static void setScaleFactor( const qreal scaleFactor );
36 | static void resetScaleFactor();
37 | static QPen scalePen( const QPen& pen );
38 |
39 | private:
40 | PrintingParameters();
41 | static PrintingParameters* instance();
42 |
43 | qreal m_scaleFactor;
44 | };
45 | }
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/src/KChart/KChartThreeDLineAttributes_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTTHREEDLINEATTRIBUTES_P_H
10 | #define KCHARTTHREEDLINEATTRIBUTES_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 | #include
25 | #include "KChartMath_p.h"
26 |
27 |
28 | namespace KChart {
29 |
30 | /**
31 | * \internal
32 | */
33 | class Q_DECL_HIDDEN ThreeDLineAttributes::Private : public AbstractThreeDAttributes::Private
34 | {
35 | friend class ThreeDLineAttributes;
36 | public:
37 | Private();
38 |
39 | private:
40 | //ThreeDLines
41 | uint lineXRotation;
42 | uint lineYRotation;
43 | };
44 |
45 | KCHART_DERIVED_PRIVATE_FOOTER(ThreeDLineAttributes, AbstractThreeDAttributes)
46 |
47 | }
48 |
49 |
50 | #endif // KCHARTTHREEDLINEATTRIBUTES_P_H
51 |
--------------------------------------------------------------------------------
/src/KChart/KChart_LeveyJennings_resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | resources/circle_blue_red.svg
5 | resources/circle_blue.svg
6 | resources/karo_black.svg
7 | resources/karo_blue.svg
8 | resources/karo_red.svg
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/KChart/KTextDocument.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KTEXTDOCUMENT_H
10 | #define KTEXTDOCUMENT_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 | #include
25 |
26 | /**
27 | * KTextDocument is an internally used enhanced QTextDocument
28 | * \internal
29 | */
30 | class KTextDocument : public QTextDocument
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit KTextDocument( QObject* parent = nullptr );
36 | explicit KTextDocument( const QString& text, QObject* parent = nullptr );
37 | ~KTextDocument() override;
38 |
39 | QSize sizeHint();
40 | QSize minimumSizeHint();
41 |
42 | private:
43 | QSize sizeForWidth( int width );
44 |
45 | private:
46 | bool mHintValid;
47 | QSize mSizeHint;
48 | QSize mMinimumSizeHint;
49 | };
50 |
51 |
52 | #endif /* KTEXTDOCUMENT_H */
53 |
54 |
--------------------------------------------------------------------------------
/src/KChart/Mainpage.dox:
--------------------------------------------------------------------------------
1 | /**
2 | * \mainpage KChart
3 | */
4 |
5 | // DOXYGEN_SET_PROJECT_NAME = KChart
6 | // DOXYGEN_SET_IGNORE_PREFIX = K
7 |
--------------------------------------------------------------------------------
/src/KChart/Messages.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Extract strings from all source files.
4 | # EXTRACT_TR_STRINGS extracts strings with lupdate and convert them to .pot with
5 | # lconvert.
6 | $EXTRACT_TR_STRINGS `find . -name \*.cpp -o -name \*.h -o -name \*.ui` -o $podir/kchart6_qt.pot
7 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartAbstractPolarDiagram.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "KChartAbstractPolarDiagram.h"
10 | #include "KChartAbstractPolarDiagram_p.h"
11 |
12 | #include "KChartMath_p.h"
13 |
14 |
15 | using namespace KChart;
16 |
17 | AbstractPolarDiagram::Private::Private()
18 | {
19 | }
20 |
21 | AbstractPolarDiagram::Private::~Private()
22 | {
23 | }
24 |
25 | void AbstractPolarDiagram::init()
26 | {
27 | }
28 |
29 | #define d d_func()
30 |
31 | AbstractPolarDiagram::AbstractPolarDiagram (
32 | QWidget* parent, PolarCoordinatePlane* plane )
33 | : AbstractDiagram ( new Private(), parent, plane )
34 | {
35 | }
36 |
37 |
38 | const PolarCoordinatePlane * AbstractPolarDiagram::polarCoordinatePlane() const
39 | {
40 | return dynamic_cast( coordinatePlane() );
41 | }
42 |
43 | int AbstractPolarDiagram::columnCount() const
44 | {
45 | return static_cast( numberOfValuesPerDataset() );
46 | }
47 |
48 | int AbstractPolarDiagram::rowCount() const
49 | {
50 | return static_cast( numberOfDatasets() );
51 | }
52 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartPieAttributes_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHART_PIE_ATTRIBUTES_P_H
10 | #define KCHART_PIE_ATTRIBUTES_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 | #include "KChartMath_p.h"
25 |
26 |
27 | namespace KChart {
28 |
29 | /**
30 | * \internal
31 | */
32 | class Q_DECL_HIDDEN PieAttributes::Private
33 | {
34 | friend class PieAttributes;
35 | public:
36 | Private();
37 |
38 | qreal explodeFactor;
39 | qreal tangentialGapFactor;
40 | qreal radialGapFactor;
41 | };
42 |
43 | }
44 |
45 | #endif // KCHART_PIE_ATTRIBUTES_P_H
46 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartPolarGrid.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTPOLARGrid_H
10 | #define KCHARTPOLARGrid_H
11 |
12 | #include "KChartPolarCoordinatePlane.h"
13 | #include "KChartAbstractGrid.h"
14 |
15 | namespace KChart {
16 |
17 | class PaintContext;
18 | class PolarCoordinatePlane;
19 |
20 | /**
21 | * \internal
22 | *
23 | * \brief Class for the grid in a polar plane.
24 | *
25 | * The PolarGrid interface is used
26 | * for calculating and for drawing
27 | * the sagittal grid lines, and the circular grid lines
28 | * of a polar coordinate plane.
29 | */
30 | class PolarGrid : public AbstractGrid
31 | {
32 | public:
33 | PolarGrid() : AbstractGrid() {}
34 | ~PolarGrid() override {}
35 |
36 | void drawGrid( PaintContext* context ) override;
37 |
38 | private:
39 | DataDimensionsList calculateGrid(
40 | const DataDimensionsList& rawDataDimensions ) const override;
41 | };
42 |
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartRadarCoordinatePlane.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "KChartRadarCoordinatePlane.h"
10 | #include "KChartRadarCoordinatePlane_p.h"
11 |
12 |
13 | using namespace KChart;
14 |
15 | #define d d_func()
16 |
17 | KChart::RadarCoordinatePlane::RadarCoordinatePlane ( Chart* parent ) :
18 | PolarCoordinatePlane( new Private(), parent )
19 | {
20 | }
21 | KChart::RadarCoordinatePlane::~RadarCoordinatePlane()
22 | {
23 | }
24 |
25 | void KChart::RadarCoordinatePlane::setTextAttributes(const KChart::TextAttributes& attr)
26 | {
27 | d->textAttributes = attr;
28 | }
29 |
30 | const KChart::TextAttributes RadarCoordinatePlane::textAttributes() const
31 | {
32 | return d->textAttributes;
33 | }
34 |
35 | void RadarCoordinatePlane::init()
36 | {
37 | // this block left empty intentionally
38 | }
39 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartRadarCoordinatePlane_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTRADARCOORDINATEPLANE_P_H
10 | #define KCHARTRADARCOORDINATEPLANE_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include "KChartPolarCoordinatePlane_p.h"
24 | #include "KChartRadarCoordinatePlane.h"
25 | #include "KChartRadarGrid.h"
26 |
27 |
28 | namespace KChart {
29 |
30 | class Q_DECL_HIDDEN RadarCoordinatePlane::Private : public PolarCoordinatePlane::Private
31 | {
32 | friend class RadarCoordinatePlane;
33 | public:
34 | explicit Private() { }
35 |
36 | ~Private() override { }
37 | TextAttributes textAttributes;
38 |
39 | void initialize() override
40 | {
41 | grid = new RadarGrid();
42 | }
43 | };
44 |
45 |
46 | KCHART_IMPL_DERIVED_PLANE(RadarCoordinatePlane, PolarCoordinatePlane)
47 |
48 | }
49 |
50 | #endif /* KCHARTBARDIAGRAM_P_H */
51 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartRadarGrid.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTRADARGrid_H
10 | #define KCHARTRADARGrid_H
11 |
12 | //#include "KChartRadarCoordinatePlane.h"
13 | #include "KChartAbstractGrid.h"
14 |
15 | namespace KChart {
16 |
17 | class PaintContext;
18 | class RadarCoordinatePlane;
19 |
20 | /**
21 | * \internal
22 | *
23 | * \brief Class for the grid in a radar plane.
24 | *
25 | * The RadarGrid interface is used
26 | * for calculating and for drawing
27 | * the grid lines of a radar charts including "axis"
28 | * labels.
29 | */
30 | class RadarGrid : public AbstractGrid
31 | {
32 | public:
33 | RadarGrid() : AbstractGrid() {}
34 | ~RadarGrid() override {}
35 |
36 | void drawGrid( PaintContext* context ) override;
37 |
38 | private:
39 | DataDimensionsList calculateGrid(
40 | const DataDimensionsList& rawDataDimensions ) const override;
41 | };
42 |
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/src/KChart/Polar/KChartThreeDPieAttributes_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTTHREEDPIEATTRIBUTES_P_H
10 | #define KCHARTTHREEDPIEATTRIBUTES_P_H
11 |
12 | //
13 | // W A R N I N G
14 | // -------------
15 | //
16 | // This file is not part of the KD Chart API. It exists purely as an
17 | // implementation detail. This header file may change from version to
18 | // version without notice, or even be removed.
19 | //
20 | // We mean it.
21 | //
22 |
23 | #include
24 | #include
25 | #include "KChartMath_p.h"
26 |
27 |
28 | namespace KChart {
29 |
30 | /**
31 | * \internal
32 | */
33 | class Q_DECL_HIDDEN ThreeDPieAttributes::Private : public AbstractThreeDAttributes::Private
34 | {
35 | friend class ThreeDPieAttributes;
36 | public:
37 | Private();
38 |
39 | private:
40 | bool useShadowColors;
41 | };
42 |
43 | KCHART_DERIVED_PRIVATE_FOOTER(ThreeDPieAttributes, AbstractThreeDAttributes)
44 |
45 | }
46 |
47 |
48 | #endif // KCHARTTHREEDPIEATTRIBUTES_P_H
49 |
--------------------------------------------------------------------------------
/src/KChart/Ternary/KChartTernaryLineDiagram.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTTERNARYLINEDIAGRAM_H
10 | #define KCHARTTERNARYLINEDIAGRAM_H
11 |
12 | #include "KChartTernaryCoordinatePlane.h"
13 | #include "KChartAbstractTernaryDiagram.h"
14 |
15 |
16 | namespace KChart {
17 |
18 | /**
19 | * @brief A TernaryLineDiagram is a line diagram with a ternary coordinate plane
20 | */
21 | class KCHART_EXPORT TernaryLineDiagram : public AbstractTernaryDiagram
22 | {
23 | Q_OBJECT
24 | Q_DISABLE_COPY( TernaryLineDiagram )
25 | KCHART_DECLARE_DERIVED_DIAGRAM( TernaryLineDiagram, TernaryCoordinatePlane )
26 |
27 | public:
28 | explicit TernaryLineDiagram ( QWidget* parent = nullptr, TernaryCoordinatePlane* plane = nullptr );
29 | ~TernaryLineDiagram() override;
30 |
31 | void resize (const QSizeF &area) override;
32 | void paint (PaintContext *paintContext) override;
33 |
34 | protected:
35 | const QPair< QPointF, QPointF > calculateDataBoundaries () const override;
36 |
37 | };
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/src/KChart/Ternary/KChartTernaryPointDiagram.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KCHARTTERNARYPOINTDIAGRAM_H
10 | #define KCHARTTERNARYPOINTDIAGRAM_H
11 |
12 | #include "KChartTernaryCoordinatePlane.h"
13 | #include "KChartAbstractTernaryDiagram.h"
14 |
15 | namespace KChart {
16 |
17 | /**
18 | * @brief A TernaryPointDiagram is a point diagram within a ternary coordinate plane
19 | */
20 | class KCHART_EXPORT TernaryPointDiagram : public AbstractTernaryDiagram
21 | {
22 | Q_OBJECT
23 | Q_DISABLE_COPY( TernaryPointDiagram )
24 | KCHART_DECLARE_DERIVED_DIAGRAM( TernaryPointDiagram, TernaryCoordinatePlane )
25 |
26 | public:
27 | explicit TernaryPointDiagram ( QWidget* parent = nullptr, TernaryCoordinatePlane* plane = nullptr );
28 | ~TernaryPointDiagram() override;
29 |
30 | void resize (const QSizeF &area) override;
31 | void paint (PaintContext *paintContext) override;
32 |
33 | protected:
34 | const QPair< QPointF, QPointF > calculateDataBoundaries () const override;
35 | };
36 |
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/KChart/Ternary/TernaryConstants.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef TERNARYCONSTANTS_H
10 | #define TERNARYCONSTANTS_H
11 |
12 | #include
13 |
14 | extern const qreal Sqrt3;
15 | extern const qreal TriangleWidth;
16 | extern const qreal TriangleHeight;
17 | extern const QPointF TriangleTop;
18 | extern const QPointF TriangleBottomLeft;
19 | extern const QPointF TriangleBottomRight;
20 | extern const QPointF AxisVector_C_A;
21 | extern const QPointF Norm_C_A;
22 | extern const QPointF AxisVector_B_A;
23 | extern const QPointF Norm_B_A;
24 | extern const QPointF AxisVector_B_C;
25 | extern const QPointF Norm_B_C;
26 | extern const qreal RelMarkerLength;
27 | extern const QPointF FullMarkerDistanceBC;
28 | extern const QPointF FullMarkerDistanceAC;
29 | extern const QPointF FullMarkerDistanceBA;
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/src/KChart/Ternary/TernaryPoint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef TERNARYPOINT_H
10 | #define TERNARYPOINT_H
11 |
12 | #include
13 | #include
14 |
15 | /**
16 | * @brief TernaryPoint defines a point within a ternary coordinate plane
17 | * \internal
18 | */
19 | class TernaryPoint
20 | {
21 | public:
22 | TernaryPoint();
23 | TernaryPoint( qreal a, qreal b );
24 |
25 | qreal a() const { return m_a; }
26 | qreal b() const { return m_b; }
27 | qreal c() const { return 1.0 - m_a - m_b; }
28 |
29 | void set( qreal a, qreal b );
30 |
31 | bool isValid() const;
32 |
33 | private:
34 | qreal m_a;
35 | qreal m_b;
36 | };
37 |
38 | QDebug operator<<( QDebug stream, const TernaryPoint& point );
39 |
40 | QPointF translate( const TernaryPoint& );
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractArea:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractArea.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractAreaBase:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractAreaBase.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractAreaWidget:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractAreaWidget.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractAxis:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractAxis.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractCartesianDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractCartesianDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractGrid:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractPieDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractPieDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractPolarDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractPolarDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractProxyModel:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractProxyModel.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractTernaryDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractTernaryDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAbstractThreeDAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartAbstractThreeDAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAttributesModel:
--------------------------------------------------------------------------------
1 | #include "KChartAttributesModel.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartAutoSpacerLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartBackgroundAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartBackgroundAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartBarAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartBarAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartBarDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartBarDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartCartesianAxis:
--------------------------------------------------------------------------------
1 | #include "KChartCartesianAxis.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartCartesianCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartCartesianCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartCartesianGrid:
--------------------------------------------------------------------------------
1 | #include "KChartCartesianGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartChart:
--------------------------------------------------------------------------------
1 | #include "KChartChart.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartDataValueAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartDataValueAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartDatasetProxyModel:
--------------------------------------------------------------------------------
1 | #include "KChartDatasetProxyModel.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartDatasetSelector:
--------------------------------------------------------------------------------
1 | #include "KChartDatasetSelector.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartDatasetSelectorWidget:
--------------------------------------------------------------------------------
1 | #include "KChartDatasetSelector.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartDiagramObserver:
--------------------------------------------------------------------------------
1 | #include "KChartDiagramObserver.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartEnums:
--------------------------------------------------------------------------------
1 | #include "KChartEnums.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartFrameAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartFrameAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartGlobal:
--------------------------------------------------------------------------------
1 | #include "KChartGlobal.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartGridAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartGridAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartHeaderFooter:
--------------------------------------------------------------------------------
1 | #include "KChartHeaderFooter.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartHorizontalLineLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartKDChartEnums:
--------------------------------------------------------------------------------
1 | #include "KChartEnums.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLayoutItems:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLegend:
--------------------------------------------------------------------------------
1 | #include "KChartLegend.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLeveyJenningsAxis:
--------------------------------------------------------------------------------
1 | #include "KChartLeveyJenningsAxis.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLeveyJenningsCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartLeveyJenningsCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLeveyJenningsDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartLeveyJenningsDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLeveyJenningsGrid:
--------------------------------------------------------------------------------
1 | #include "KChartLeveyJenningsGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLeveyJenningsGridAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartLeveyJenningsGridAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLineAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartLineAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLineDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartLineDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLineLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartLineWithMarkerLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartMarkerAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartMarkerAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartMarkerLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartMeasure:
--------------------------------------------------------------------------------
1 | #include "KChartMeasure.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartNullPaintDevice:
--------------------------------------------------------------------------------
1 | #include "KChartNullPaintDevice.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPaintContext:
--------------------------------------------------------------------------------
1 | #include "KChartPaintContext.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPalette:
--------------------------------------------------------------------------------
1 | #include "KChartPalette.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPieAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartPieAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPieDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartPieDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPlotter:
--------------------------------------------------------------------------------
1 | #include "KChartPlotter.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPlotterDiagramCompressor:
--------------------------------------------------------------------------------
1 | #include "KChartPlotterDiagramCompressor.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPolarCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartPolarCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPolarDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartPolarDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPolarGrid:
--------------------------------------------------------------------------------
1 | #include "KChartPolarGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPosition:
--------------------------------------------------------------------------------
1 | #include "KChartPosition.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPositionPoints:
--------------------------------------------------------------------------------
1 | #include "KChartPosition.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartPrintingParameters:
--------------------------------------------------------------------------------
1 | #include "KChartPrintingParameters.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRadarCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartRadarCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRadarDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartRadarDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRadarGrid:
--------------------------------------------------------------------------------
1 | #include "KChartRadarGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRelativePosition:
--------------------------------------------------------------------------------
1 | #include "KChartRelativePosition.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRingDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartRingDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartRulerAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartRulerAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartSignalCompressor:
--------------------------------------------------------------------------------
1 | #include "KChartSignalCompressor.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartStockBarAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartStockBarAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartStockDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartStockDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTernaryAxis:
--------------------------------------------------------------------------------
1 | #include "KChartTernaryAxis.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTernaryCoordinatePlane:
--------------------------------------------------------------------------------
1 | #include "KChartTernaryCoordinatePlane.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTernaryGrid:
--------------------------------------------------------------------------------
1 | #include "KChartTernaryGrid.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTernaryLineDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartTernaryLineDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTernaryPointDiagram:
--------------------------------------------------------------------------------
1 | #include "KChartTernaryPointDiagram.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTextArea:
--------------------------------------------------------------------------------
1 | #include "KChartTextArea.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTextAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartTextAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTextBubbleLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTextLabelCache:
--------------------------------------------------------------------------------
1 | #include "KChartTextLabelCache.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartTextLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartThreeDBarAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartThreeDBarAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartThreeDLineAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartThreeDLineAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartThreeDPieAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartThreeDPieAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartValueTrackerAttributes:
--------------------------------------------------------------------------------
1 | #include "KChartValueTrackerAttributes.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartVerticalLineLayoutItem:
--------------------------------------------------------------------------------
1 | #include "KChartLayoutItems.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartWidget:
--------------------------------------------------------------------------------
1 | #include "KChartWidget.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/include/KChartZoomParameters:
--------------------------------------------------------------------------------
1 | #include "KChartZoomParameters.h"
2 |
--------------------------------------------------------------------------------
/src/KChart/metainfo.yaml:
--------------------------------------------------------------------------------
1 | # kapidox info
2 | repo_id: kdiagram
3 | fancyname: KChart
4 | description: A library for creating business charts
5 | #logo: TODO
6 | group: kdiagram
7 | type: functional
8 |
9 | platforms:
10 | - name: Linux
11 | - name: FreeBSD
12 | - name: Windows
13 | - name: macOS
14 | # - name: Android
15 |
16 | public_lib: true
17 | public_source_dirs:
18 | - .
19 | libraries:
20 | - cmake: KChart
21 | qmake: KChart
22 | cmakename: KChart
23 |
24 | maintainer:
25 | - danders
26 |
27 | # group info has to be with one of the covered projects currently
28 | group_info:
29 | name: KDiagram
30 | fancyname: The KDiagram Libraries
31 | maintainer:
32 | - danders
33 | irc: calligra
34 | mailinglist: calligra-devel
35 | platforms:
36 | - Linux
37 | - FreeBSD
38 | - Windows
39 | - macOS
40 | # - Android
41 | description: Libraries for creating charts and Gantt diagrams
42 | long_description:
43 | - The KDiagram Libraries consist of KChart, a library for creating business charts,
44 | and KGantt, a library for creating Gantt diagrams
45 | - The KDiagram Libraries can be used in CMake-based and QMake-based projects.
46 | # logo: TODO
47 |
--------------------------------------------------------------------------------
/src/KGantt/KGantt6Config.cmake.in:
--------------------------------------------------------------------------------
1 | @PACKAGE_INIT@
2 |
3 | include(CMakeFindDependencyMacro)
4 | find_dependency(Qt6Core @QT_REQUIRED_VERSION@)
5 | find_dependency(Qt6Widgets @QT_REQUIRED_VERSION@)
6 | find_dependency(Qt6PrintSupport @QT_REQUIRED_VERSION@)
7 |
8 | include("${CMAKE_CURRENT_LIST_DIR}/KGantt6Targets.cmake")
9 | @PACKAGE_INCLUDE_QCHTARGETS@
10 |
--------------------------------------------------------------------------------
/src/KGantt/Mainpage.dox:
--------------------------------------------------------------------------------
1 | /**
2 | * \mainpage KGantt
3 | */
4 |
5 | // DOXYGEN_SET_PROJECT_NAME = KGantt
6 | // DOXYGEN_SET_IGNORE_PREFIX = K
7 |
--------------------------------------------------------------------------------
/src/KGantt/Messages.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Extract strings from all source files.
4 | # EXTRACT_TR_STRINGS extracts strings with lupdate and convert them to .pot with
5 | # lconvert.
6 | $EXTRACT_TR_STRINGS `find . -name \*.cpp -o -name \*.h` -o $podir/kgantt6_qt.pot
7 |
--------------------------------------------------------------------------------
/src/KGantt/kganttabstractgrid_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTABSTRACTGRID_P_H
10 | #define KGANTTABSTRACTGRID_P_H
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | #include "kganttabstractgrid.h"
17 |
18 | namespace KGantt {
19 | class Q_DECL_HIDDEN AbstractGrid::Private {
20 | public:
21 | virtual ~Private() {}
22 | QPointer model;
23 | QPersistentModelIndex root;
24 | };
25 |
26 | inline AbstractGrid::AbstractGrid( Private* d ) : _d( d ) {}
27 | }
28 |
29 | #endif /* KGANTTABSTRACTGRID_P_H */
30 |
31 |
--------------------------------------------------------------------------------
/src/KGantt/kganttabstractrowcontroller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "kganttabstractrowcontroller.h"
10 |
11 | using namespace KGantt;
12 |
13 |
14 | AbstractRowController::AbstractRowController()
15 | {
16 | }
17 |
18 |
19 | AbstractRowController::~AbstractRowController()
20 | {
21 | }
22 |
--------------------------------------------------------------------------------
/src/KGantt/kganttconstraint_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTCONSTRAINT_P_H
10 | #define KGANTTCONSTRAINT_P_H
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | #include "kganttconstraint.h"
17 |
18 | namespace KGantt {
19 | class Q_DECL_HIDDEN Constraint::Private : public QSharedData {
20 | public:
21 | Private();
22 | Private( const Private& other );
23 |
24 | inline bool equals( const Private& other ) const {
25 | /* Due to a Qt bug we have to check separately for invalid indexes */
26 | return (start==other.start || (!start.isValid() && !other.start.isValid()))
27 | && (end==other.end || (!end.isValid() && !other.end.isValid()))
28 | && type==other.type
29 | && relationType==other.relationType
30 | && data==other.data;
31 | }
32 |
33 | QPersistentModelIndex start;
34 | QPersistentModelIndex end;
35 | Type type;
36 | RelationType relationType;
37 | QMap< int, QVariant > data;
38 | };
39 | }
40 |
41 | #endif /* KGANTTCONSTRAINT_P_H */
42 |
43 |
--------------------------------------------------------------------------------
/src/KGantt/kganttconstraintmodel_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTCONSTRAINTMODEL_P_H
10 | #define KGANTTCONSTRAINTMODEL_P_H
11 |
12 | #include "kganttconstraintmodel.h"
13 |
14 | #include
15 | #include
16 | #include
17 |
18 | namespace KGantt {
19 | class Q_DECL_HIDDEN ConstraintModel::Private {
20 | public:
21 | Private();
22 |
23 | void addConstraintToIndex( const QModelIndex& idx, const Constraint& c );
24 | void removeConstraintFromIndex( const QModelIndex& idx, const Constraint& c );
25 |
26 | typedef QMultiHash IndexType;
27 |
28 | QList constraints;
29 | IndexType indexMap;
30 | };
31 | }
32 |
33 | #endif /* KGANTTCONSTRAINTMODEL_P_H */
34 |
35 |
--------------------------------------------------------------------------------
/src/KGantt/kganttdatetimetimelinedialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2020 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTDATETIMETIMELINEDIALOG_H
10 | #define KGANTTDATETIMETIMELINEDIALOG_H
11 |
12 | #include "kganttglobal.h"
13 | #include
14 |
15 | QT_BEGIN_NAMESPACE
16 | class QWidget;
17 | QT_END_NAMESPACE
18 |
19 | namespace KGantt {
20 | class DateTimeTimeLine;
21 |
22 | class DateTimeTimeLineDialog : public QDialog {
23 | Q_OBJECT
24 | public:
25 | explicit DateTimeTimeLineDialog(DateTimeTimeLine *timeLine, QWidget* parent = nullptr);
26 | ~DateTimeTimeLineDialog() override;
27 |
28 | private Q_SLOTS:
29 | void ok();
30 | void openColorDialog();
31 | void updateColorButton();
32 |
33 | private:
34 | class Private;
35 | Private *d;
36 | };
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/KGantt/kganttitemdelegate_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTITEMDELEGATE_P_H
10 | #define KGANTTITEMDELEGATE_P_H
11 |
12 | #include "kganttitemdelegate.h"
13 |
14 | #include
15 |
16 | namespace KGantt {
17 | class Q_DECL_HIDDEN ItemDelegate::Private {
18 | public:
19 | Private();
20 |
21 | QPen constraintPen( const QPointF& start, const QPointF& end, const Constraint& constraint, const QStyleOptionGraphicsItem& opt );
22 |
23 | QHash defaultbrush;
24 | QHash defaultpen;
25 | };
26 | }
27 |
28 | #endif /* KGANTTITEMDELEGATE_P_H */
29 |
30 |
--------------------------------------------------------------------------------
/src/KGantt/kganttlegend_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTLEGEND_P_H
10 | #define KGANTTLEGEND_P_H
11 |
12 | #include "kganttlegend.h"
13 |
14 | #include "kganttproxymodel.h"
15 |
16 | namespace KGantt {
17 | class Q_DECL_HIDDEN Legend::Private {
18 | public:
19 | ProxyModel proxyModel;
20 | };
21 | }
22 |
23 | #endif /* KGANTTLEGEND_P_H */
24 |
25 |
--------------------------------------------------------------------------------
/src/KGantt/kganttlistviewrowcontroller_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTLISTVIEWROWCONTROLLER_P_H
10 | #define KGANTTLISTVIEWROWCONTROLLER_P_H
11 |
12 | #include "kganttlistviewrowcontroller.h"
13 |
14 | #include
15 |
16 | namespace KGantt {
17 | class Q_DECL_HIDDEN ListViewRowController::Private {
18 | public:
19 | class HackListView : public QListView {
20 | public:
21 | using QListView::verticalOffset;
22 | using QListView::setViewportMargins;
23 | };
24 |
25 | Private(QListView* lv, QAbstractProxyModel* pm )
26 | : listview(lv), proxy(pm) {}
27 | QListView* listview;
28 | QAbstractProxyModel* proxy;
29 | };
30 | }
31 |
32 | #endif /* KGANTTLISTVIEWROWCONTROLLER_P_H */
33 |
34 |
--------------------------------------------------------------------------------
/src/KGantt/kganttpenstylecombobox.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2020 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTPENSTYLECOMBOBOX_H
10 | #define KGANTTPENSTYLECOMBOBOX_H
11 |
12 | #include
13 |
14 | #include "kgantt_export.h"
15 |
16 | QT_BEGIN_NAMESPACE
17 | class QPaintEvent;
18 | QT_END_NAMESPACE
19 |
20 | namespace KGantt {
21 |
22 | class KGANTT_EXPORT PenStyleComboBox : public QComboBox
23 | {
24 | Q_OBJECT
25 | public:
26 | explicit PenStyleComboBox(QWidget *parent = nullptr);
27 |
28 | void setCurrentStyle(Qt::PenStyle style);
29 | Qt::PenStyle currentStyle() const;
30 |
31 | protected:
32 | void paintEvent(QPaintEvent *pe) override;
33 | };
34 | }
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/src/KGantt/kganttpenstylecombobox_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2020 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTPENSTYLECOMBOBOX_P_H
10 | #define KGANTTPENSTYLECOMBOBOX_P_H
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | namespace KGantt {
17 |
18 | class PenStyleComboBoxListView : public QListView
19 | {
20 | Q_OBJECT
21 | public:
22 | PenStyleComboBoxListView(QComboBox *cmb = nullptr);
23 |
24 | protected:
25 | void resizeEvent(QResizeEvent *event) override;
26 | void paintEvent(QPaintEvent *e) override;
27 |
28 | private:
29 | QComboBox *combo;
30 | };
31 | }
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/src/KGantt/kganttproxymodel_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTPROXYMODEL_P_H
10 | #define KGANTTPROXYMODEL_P_H
11 |
12 | #include "kganttproxymodel.h"
13 |
14 | #include
15 |
16 | namespace KGantt {
17 | class Q_DECL_HIDDEN ProxyModel::Private {
18 | public:
19 | explicit Private( ProxyModel* _q );
20 |
21 | QHash columnMap;
22 | QHash roleMap;
23 | bool calendarMode;
24 | };
25 | }
26 |
27 | #endif /* KGANTTPROXYMODEL_P_H */
28 |
29 |
--------------------------------------------------------------------------------
/src/KGantt/kganttstyleoptionganttitem.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTSTYLEOPTIONGANTTITEM_H
10 | #define KGANTTSTYLEOPTIONGANTTITEM_H
11 |
12 | #include "kganttglobal.h"
13 |
14 | #include
15 | #include
16 | #include
17 |
18 | namespace KGantt {
19 | class AbstractGrid;
20 | class KGANTT_EXPORT StyleOptionGanttItem : public QStyleOptionViewItem {
21 | public:
22 | enum Position { Left, Right, Center, Hidden };
23 |
24 | StyleOptionGanttItem();
25 | StyleOptionGanttItem( const StyleOptionGanttItem& other );
26 | StyleOptionGanttItem& operator=( const StyleOptionGanttItem& other );
27 |
28 | QRectF boundingRect;
29 | QRectF itemRect;
30 | Position displayPosition;
31 | AbstractGrid* grid;
32 | QString text;
33 | };
34 | }
35 |
36 | #ifndef QT_NO_DEBUG_STREAM
37 |
38 | QDebug operator<<( QDebug dbg, KGantt::StyleOptionGanttItem::Position p);
39 | QDebug operator<<( QDebug dbg, const KGantt::StyleOptionGanttItem& s );
40 |
41 | #endif /* QT_NO_DEBUG_STREAM */
42 |
43 |
44 | #endif /* KGANTTSTYLEOPTIONGANTTITEM_H */
45 |
46 |
--------------------------------------------------------------------------------
/src/KGantt/kganttsummaryhandlingproxymodel_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTSUMMARYHANDLINGPROXYMODEL_P_H
10 | #define KGANTTSUMMARYHANDLINGPROXYMODEL_P_H
11 |
12 | #include "kganttsummaryhandlingproxymodel.h"
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | namespace KGantt {
20 | class Q_DECL_HIDDEN SummaryHandlingProxyModel::Private {
21 | public:
22 | bool cacheLookup( const QModelIndex& idx,
23 | QPair* result ) const;
24 | void insertInCache( const SummaryHandlingProxyModel* model, const QModelIndex& idx ) const;
25 | void removeFromCache( const QModelIndex& idx ) const;
26 | void clearCache() const;
27 |
28 | inline bool isSummary( const QModelIndex& idx ) const {
29 | int typ = idx.data( ItemTypeRole ).toInt();
30 | return (typ==TypeSummary) || (typ==TypeMulti);
31 | }
32 |
33 | mutable QHash > cached_summary_items;
34 | };
35 | }
36 |
37 | #endif /* KGANTTSUMMARYHANDLINGPROXYMODEL_P_H */
38 |
39 |
--------------------------------------------------------------------------------
/src/KGantt/kgantttreeviewrowcontroller_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef KGANTTTREEVIEWROWCONTROLLER_P_H
10 | #define KGANTTTREEVIEWROWCONTROLLER_P_H
11 |
12 | #include "kgantttreeviewrowcontroller.h"
13 |
14 | #include
15 |
16 | QT_BEGIN_NAMESPACE
17 | class QAbstractProxyModel;
18 | QT_END_NAMESPACE
19 |
20 | namespace KGantt {
21 | class Q_DECL_HIDDEN TreeViewRowController::Private {
22 | public:
23 | class HackTreeView : public QTreeView {
24 | public:
25 | using QTreeView::verticalOffset;
26 | using QTreeView::rowHeight;
27 | };
28 | HackTreeView* treeview;
29 | QAbstractProxyModel* proxy;
30 | };
31 | }
32 |
33 | #endif /* KGANTTTREEVIEWROWCONTROLLER_P_H */
34 |
35 |
--------------------------------------------------------------------------------
/src/KGantt/metainfo.yaml:
--------------------------------------------------------------------------------
1 | # kapidox info
2 | repo_id: kdiagram
3 | fancyname: KGantt
4 | description: A library for creating Gantt diagrams
5 | #logo: TODO
6 | group: kdiagram
7 | type: functional
8 |
9 | platforms:
10 | - name: Linux
11 | - name: FreeBSD
12 | - name: Windows
13 | - name: macOS
14 | # - name: Android
15 |
16 | public_lib: true
17 | public_source_dirs:
18 | - .
19 | libraries:
20 | - cmake: KGantt
21 | qmake: KGantt
22 | cmakename: KGantt
23 |
24 | maintainer:
25 | - danders
26 |
--------------------------------------------------------------------------------
/src/KGantt/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | # qt_add_resources(TestKChartAttributesModel_SRCS
3 | # Data.qrc
4 | # )
5 |
6 | ecm_add_test(TestKGanttConstraint.cpp
7 | TEST_NAME KGanttConstraint
8 | LINK_LIBRARIES KGantt6 Qt::Test
9 | )
10 |
11 | ecm_add_test(TestKGanttConstraintModel.cpp
12 | TEST_NAME KGanttConstraintModel
13 | LINK_LIBRARIES KGantt6 Qt::Test
14 | )
15 |
16 | ecm_add_test(TestMultiItems.cpp
17 | TEST_NAME KGanttMultiItems
18 | LINK_LIBRARIES KGantt6 Qt::Test
19 | )
20 |
21 | ecm_add_test(TestKGanttView.cpp
22 | TEST_NAME KGanttView
23 | LINK_LIBRARIES PUBLIC KGantt6 Qt::Test
24 | )
25 |
--------------------------------------------------------------------------------
/src/KGantt/test/TestKGanttConstraint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2018 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: LGPL-2.0-or-later
7 | */
8 | #ifndef TESTGANTTCONSTRAINT_H
9 | #define TESTGANTTCONSTRAINT_H
10 |
11 | #include
12 |
13 |
14 | class TestKGanttConstraint : public QObject
15 | {
16 | Q_OBJECT
17 |
18 | private Q_SLOTS:
19 | void initTestCase();
20 | void cleanupTestCase();
21 | void test();
22 | };
23 | #endif
24 |
--------------------------------------------------------------------------------
/src/KGantt/test/TestKGanttConstraintModel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2018 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: LGPL-2.0-or-later
7 | */
8 | #ifndef TESTKGANTTCONSTRAINTMODEL_H
9 | #define TESTKGANTTCONSTRAINTMODEL_H
10 |
11 | #include
12 | #include
13 |
14 |
15 | class TestKGanttConstraintModel : public QObject
16 | {
17 | Q_OBJECT
18 | private:
19 | QStandardItemModel *itemModel;
20 |
21 | private Q_SLOTS:
22 | void initTestCase();
23 | void cleanupTestCase();
24 | void testModel();
25 | };
26 | #endif
27 |
--------------------------------------------------------------------------------
/src/KGantt/test/TestKGanttView.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2018 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: LGPL-2.0-or-later
7 | */
8 | #ifndef TESTKGANTTVIEW_H
9 | #define TESTKGANTTVIEW_H
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #include "kganttview.h"
16 |
17 | namespace KGantt {
18 | class GraphicsScene;
19 | }
20 |
21 | class TestKGanttView : public QObject
22 | {
23 | Q_OBJECT
24 | private:
25 | QStandardItemModel *itemModel;
26 | KGantt::View *view;
27 |
28 | void initListModel();
29 | void initTreeModel();
30 |
31 | private Q_SLOTS:
32 | void init();
33 | void cleanup();
34 |
35 | void testApi();
36 |
37 | // default view is a treeview
38 | void testDefaultView();
39 |
40 | void testTreeView();
41 |
42 | void testListView();
43 |
44 | void testConstraints();
45 |
46 | void testSetGraphicsView();
47 |
48 | void testSetRowController();
49 | };
50 | #endif
51 |
--------------------------------------------------------------------------------
/src/KGantt/test/TestMultiItems.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2020 Dag Andersen
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: LGPL-2.0-or-later
7 | */
8 | #ifndef TESTMULTIITEMS_H
9 | #define TESTMULTIITEMS_H
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #include "kganttview.h"
16 |
17 | class TestMultiItems : public QObject
18 | {
19 | Q_OBJECT
20 | private:
21 | QStandardItemModel *itemModel;
22 | KGantt::View *view;
23 |
24 | void initMultiModel();
25 |
26 | private Q_SLOTS:
27 | void init();
28 | void cleanup();
29 |
30 | // default view is a treeview
31 | void testDefaultView();
32 |
33 | void testTreeView();
34 |
35 | void testListView();
36 |
37 | void testConstraints();
38 | };
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/KGantt/unittest/libutil.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef __ASCSHARED_UTIL_LIBUTIL_H__
10 | #define __ASCSHARED_UTIL_LIBUTIL_H__
11 |
12 | // These two macros can be used to force the loading of static objects in static libraries.
13 | // Under normal circumstances, the linker automatically discards unused library symbols from the final executable,
14 | // which is a problem for static objects with a constructor performing a specific action such as registration.
15 | // Note that the export macro only needs to be included once per .cpp file (even if there are many static objects in the file).
16 | // Parameters :
17 | // - ID : an file-wide identifier, e.g. the filename without the extension.
18 | // It shouldn't be quoted, no spaces, and contain only alphanumerical characters.
19 | #define KDAB_EXPORT_STATIC_SYMBOLS( ID ) int __init_##ID##_static_symbols() { return 0; }
20 | #define KDAB_IMPORT_STATIC_SYMBOLS( ID ) extern int __init_##ID##_static_symbols(); \
21 | static int fake_init##ID = __init_##ID##_static_symbols();
22 |
23 | #endif // __ASCSHARED_UTIL_LIBUTIL_H__
24 |
--------------------------------------------------------------------------------
/src/TODO:
--------------------------------------------------------------------------------
1 | cleanup:
2 | --------
3 |
4 | KChartArea -> KChart::Area
5 |
6 | KChartAxis?
7 |
8 | KChartCustomArea?
9 |
10 | KTextDocument ?
11 |
12 | KChartMeasure ?
13 |
--------------------------------------------------------------------------------
/src/libkdchart.map:
--------------------------------------------------------------------------------
1 | VERSION
2 | {
3 | local:
4 | extern "C++"
5 | {
6 | KChart::*::Private::*;
7 | KChart::*::Private?virtual?table;
8 | KChart::*::Private?type_info?node;
9 | KChart::*::Private?type_info?name;
10 | KChart::*::Private?type_info?function;
11 | vtable?for?KChart::*::Private;
12 | typeinfo?for?KChart::*::Private;
13 | typeinfo?name?for?KChart::*::Private;
14 | non-virtual?thunk?to?KChart::*::Private;
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory( Gantt )
2 |
3 | include_directories(
4 | ${CMAKE_SOURCE_DIR}/src/KChart
5 | ${CMAKE_SOURCE_DIR}/src/KChart/include
6 | ${CMAKE_SOURCE_DIR}/src/KChart/Cartesian
7 | ${CMAKE_SOURCE_DIR}/src/KChart/Cartesian/DiagramFlavors
8 | ${CMAKE_SOURCE_DIR}/src/KChart/Polar
9 | ${CMAKE_SOURCE_DIR}/src/KChart/Ternary
10 | )
11 | remove_definitions(
12 | -DQT_NO_KEYWORDS
13 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS
14 | -DQT_NO_CAST_FROM_ASCII
15 | )
16 |
17 | # Disabled for Windows cause compiling the RootIndex and DelayedData samples
18 | # with mingw or nmake results in a Q_ASSERT in qmake (cause QList.first()
19 | # is used while the QList is empty, removing the required
20 | # OBJECTS_DIR from the RootIndex.pro fixes it) if qmake was
21 | # compiled with debug enabled or in a crash if not.
22 | if(NOT WIN32)
23 | add_subdirectory( DelayedData )
24 | add_subdirectory( RootIndex )
25 | endif()
26 |
--------------------------------------------------------------------------------
/tests/DelayedData/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(DelayedData main.cpp)
2 |
3 | target_link_libraries(DelayedData KChart6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | remove_definitions(
2 | -DQT_NO_KEYWORDS
3 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS
4 | -DQT_NO_CAST_FROM_ASCII
5 | )
6 |
7 | add_subdirectory( apireview )
8 | add_subdirectory( customconstraints )
9 | add_subdirectory( gfxview )
10 | add_subdirectory( view )
11 | add_subdirectory( listview )
12 | add_subdirectory( headers )
13 | add_subdirectory( reorder )
14 | add_subdirectory( unittest )
15 |
--------------------------------------------------------------------------------
/tests/Gantt/apireview/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TestApiReview_SRCS
2 | entrydialog.cpp
3 | entrydelegate.cpp
4 | mainwindow.cpp
5 | entrydialog.h
6 | entrydelegate.h
7 | mainwindow.h
8 | main.cpp
9 | )
10 |
11 | qt_wrap_ui(TestApiReview_SRCS
12 | entrydialog.ui
13 | mainwindow.ui
14 | )
15 |
16 | add_executable(TestApiReview ${TestApiReview_SRCS})
17 |
18 | target_link_libraries(TestApiReview KGantt6 Qt::Widgets Qt::PrintSupport)
19 |
--------------------------------------------------------------------------------
/tests/Gantt/apireview/entrydelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef ENTRYDELEGATE_H
10 | #define ENTRYDELEGATE_H
11 |
12 | #include
13 |
14 | namespace KGantt {
15 | class ConstraintModel;
16 | }
17 |
18 | class EntryDelegate : public QItemDelegate {
19 | public:
20 | EntryDelegate( KGantt::ConstraintModel* constraintModel, QObject* parent = nullptr );
21 |
22 | bool editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index ) override;
23 |
24 | private:
25 | void addConstraint(const QModelIndex & index1, const QModelIndex & index2);
26 | void setReadOnly(const QModelIndex & index, bool readOnly);
27 |
28 | KGantt::ConstraintModel* constraintModel;
29 | };
30 |
31 | #endif /* ENTRYDELEGATE_H */
32 |
--------------------------------------------------------------------------------
/tests/Gantt/apireview/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include "mainwindow.h"
12 |
13 | int main( int argc, char* argv[] )
14 | {
15 | QApplication app( argc, argv );
16 |
17 | MainWindow mainWin;
18 | mainWin.show();
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/Gantt/apireview/mainwindow.ui:
--------------------------------------------------------------------------------
1 |
2 | MainWindow
3 |
4 |
5 |
6 | 0
7 | 0
8 | 556
9 | 330
10 |
11 |
12 |
13 | Qt::DefaultContextMenu
14 |
15 |
16 | KD Gantt Example
17 |
18 |
19 |
20 | -
21 |
22 |
23 |
24 |
25 |
35 |
36 |
37 |
38 |
39 | KGantt::View
40 | QWidget
41 |
42 | 1
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/tests/Gantt/customconstraints/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestCustomConstraints main.cpp)
2 |
3 | target_link_libraries(TestCustomConstraints KGantt6 Qt::Widgets Qt::PrintSupport)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/gfxview/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestGfxView main.cpp)
2 |
3 | target_link_libraries(TestGfxView KGantt6 Qt::Widgets Qt::PrintSupport)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/headers/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestHeaders main.cpp)
2 |
3 | target_link_libraries(TestHeaders KGantt6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/listview/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestListView main.cpp)
2 |
3 | target_link_libraries(TestListView KGantt6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/reorder/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestReorder main.cpp)
2 |
3 | target_link_libraries(TestReorder KGantt6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/unittest/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestUnittests main.cpp)
2 |
3 | target_link_libraries(TestUnittests KGantt6 Qt::Widgets)
4 |
--------------------------------------------------------------------------------
/tests/Gantt/unittest/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KGantt library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include "unittest/testregistry.h"
10 |
11 | #include
12 | #include
13 |
14 | int main( int argc , char ** argv ) {
15 |
16 | QApplication app( argc, argv );
17 |
18 | KDAB::UnitTest::Runner r;
19 | unsigned int failed = 0;
20 | if ( argc == 1 )
21 | failed = r.run();
22 | else {
23 | for ( int i = 1 ; i < argc ; ++i )
24 | if ( argv[i] && *argv[i] )
25 | failed += r.run( argv[i] );
26 | else {
27 | std::cerr << argv[0] << ": skipping empty group name" << std::endl;
28 | }
29 | }
30 | std::cout << failed << " tests failed." << std::endl;
31 | return failed;
32 | }
33 |
--------------------------------------------------------------------------------
/tests/Gantt/view/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(TestView main.cpp)
2 |
3 | target_link_libraries(TestView KGantt6 Qt::Widgets Qt::PrintSupport)
4 |
--------------------------------------------------------------------------------
/tests/RootIndex/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(RootIndex_SRCS
2 | mainwindow.cpp
3 | mainwindow.h
4 | main.cpp
5 | )
6 |
7 | qt_wrap_ui(RootIndex_SRCS
8 | mainwindow.ui
9 | )
10 |
11 | add_executable(RootIndex ${RootIndex_SRCS})
12 |
13 | target_link_libraries(RootIndex KChart6 Qt::Widgets)
14 |
--------------------------------------------------------------------------------
/tests/RootIndex/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #include
10 | #include "mainwindow.h"
11 |
12 | int main( int argc, char** argv ) {
13 | QApplication app( argc, argv );
14 |
15 | MainWindow mainWindow;
16 | mainWindow.show();
17 |
18 | return app.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/tests/RootIndex/mainwindow.h:
--------------------------------------------------------------------------------
1 | /**
2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 | *
4 | * This file is part of the KD Chart library.
5 | *
6 | * SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | #ifndef MAINWINDOW_H
10 | #define MAINWINDOW_H
11 |
12 | #include "ui_mainwindow.h"
13 | #include
14 |
15 | namespace KChart {
16 | class Chart;
17 | class DatasetProxyModel;
18 | class LineDiagram;
19 | class BarDiagram;
20 | class LineAttributes;
21 | class CartesianAxis;
22 | class CartesianCoordinatePlane;
23 | }
24 |
25 | class MainWindow : public QWidget, private Ui::MainWindow
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | MainWindow( QWidget* parent = nullptr );
31 |
32 | private:
33 | KChart::Chart* m_chart;
34 | QStandardItemModel m_model;
35 | QStandardItemModel m_model2;
36 | KChart::DatasetProxyModel* m_datasetProxy;
37 | KChart::LineDiagram* m_lines;
38 | KChart::BarDiagram* m_bars;
39 | KChart::CartesianCoordinatePlane* plane;
40 | // mutable KChart::CartesianAxis xAxis;
41 | //mutable KChart::CartesianAxis yAxis;
42 |
43 | };
44 |
45 |
46 | #endif /* MAINWINDOW_H */
47 |
48 |
--------------------------------------------------------------------------------