diff options
Diffstat (limited to 'src/datavisualization/doc')
4 files changed, 117 insertions, 61 deletions
diff --git a/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp b/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp index 03f6e847..623f7f6f 100644 --- a/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp +++ b/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp @@ -21,86 +21,124 @@ import QtDataVisualization 1.0 //! [0] //! [1] -Bars3D { - rows: 4 - columns: 4 - barSpacing: Qt.size(0.5, 0.5) - barSpacingRelative: false - - Bar3DSeries { - itemLabelFormat: "@valueTitle for @colLabel, @rowLabel: @valueLabel" - - ItemModelBarDataProxy { - itemModel: model // E.g. a list model defined elsewhere containing monthly expenses data. - // Mapping model roles to bar series rows, columns, and values. - rowRole: "year" - columnRole: "city" - valueRole: "expenses" - rowCategories: ["2010", "2011", "2012", "2013"] - columnCategories: ["Oulu", "Rauma", "Helsinki", "Tampere"] +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Item { + width: 640 + height: 480 + + Bars3D { + width: parent.width + height: parent.height + + Bar3DSeries { + itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" + + ItemModelBarDataProxy { + itemModel: dataModel + // Mapping model roles to bar series rows, columns, and values. + rowRole: "year" + columnRole: "city" + valueRole: "expenses" + } } } + + ListModel { + id: dataModel + ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } + ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } + ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } + ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } + ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } + ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } + ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } + ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } + } } //! [1] //! [2] -Scatter3D { - axisX.segmentCount: 2 - axisX.subSegmentCount: 2 - axisX.labelFormat: "%.2f" - axisZ.segmentCount: 2 - axisZ.subSegmentCount: 2 - axisZ.labelFormat: "%.2f" - axisY.segmentCount: 3 - axisY.subSegmentCount: 2 - axisY.labelFormat: "%.2f" - - Scatter3DSeries { - itemLabelFormat: "X:@xLabel Y:@yLabel Z:@zLabel" - - ItemModelScatterDataProxy { - itemModel: model // E.g. a list model defined elsewhere containing point coordinates. - // Mapping model roles to scatter series item coordinates. - xPosRole: "xPos" - yPosRole: "yPos" - zPosRole: "zPos" +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Item { + width: 640 + height: 480 + + Scatter3D { + width: parent.width + height: parent.height + Scatter3DSeries { + ItemModelScatterDataProxy { + itemModel: dataModel + // Mapping model roles to scatter series item coordinates. + xPosRole: "xPos" + yPosRole: "yPos" + zPosRole: "zPos" + } } } + + ListModel { + id: dataModel + ListElement{ xPos: "2.754"; yPos: "1.455"; zPos: "3.362"; } + ListElement{ xPos: "3.164"; yPos: "2.022"; zPos: "4.348"; } + ListElement{ xPos: "4.564"; yPos: "1.865"; zPos: "1.346"; } + ListElement{ xPos: "1.068"; yPos: "1.224"; zPos: "2.983"; } + ListElement{ xPos: "2.323"; yPos: "2.502"; zPos: "3.133"; } + } } //! [2] //! [3] -Surface3D { - axisX.min: 0.0 - axisX.max: 10.0 - axisZ.min: 0.0 - axisZ.max: 10.0 - axisY.min: 0.0 - axisY.max: 5.0 - axisX.segmentCount: 5 - axisX.subSegmentCount: 2 - axisX.labelFormat: "%i" - axisZ.segmentCount: 5 - axisZ.subSegmentCount: 2 - axisZ.labelFormat: "%i" - axisY.segmentCount: 5 - axisY.labelFormat: "%.1f" - - Surface3DSeries { - ItemModelSurfaceDataProxy { - itemModel: model // E.g. a list model defined elsewhere containing population data. - // Mapping model roles to surface series rows, columns, and values. - rowRole: "longitude" - columnRole: "latitude" - valueRole: "pop_density" +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Item { + width: 640 + height: 480 + + Surface3D { + width: parent.width + height: parent.height + Surface3DSeries { + itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel" + ItemModelSurfaceDataProxy { + itemModel: dataModel + // Mapping model roles to surface series rows, columns, and values. + rowRole: "longitude" + columnRole: "latitude" + valueRole: "pop_density" + } } } + ListModel { + id: dataModel + ListElement{ longitude: "20"; latitude: "10"; pop_density: "4.75"; } + ListElement{ longitude: "21"; latitude: "10"; pop_density: "3.00"; } + ListElement{ longitude: "22"; latitude: "10"; pop_density: "1.24"; } + ListElement{ longitude: "23"; latitude: "10"; pop_density: "2.53"; } + ListElement{ longitude: "20"; latitude: "11"; pop_density: "2.55"; } + ListElement{ longitude: "21"; latitude: "11"; pop_density: "2.03"; } + ListElement{ longitude: "22"; latitude: "11"; pop_density: "3.46"; } + ListElement{ longitude: "23"; latitude: "11"; pop_density: "5.12"; } + ListElement{ longitude: "20"; latitude: "12"; pop_density: "1.37"; } + ListElement{ longitude: "21"; latitude: "12"; pop_density: "2.98"; } + ListElement{ longitude: "22"; latitude: "12"; pop_density: "3.33"; } + ListElement{ longitude: "23"; latitude: "12"; pop_density: "3.23"; } + ListElement{ longitude: "20"; latitude: "13"; pop_density: "4.34"; } + ListElement{ longitude: "21"; latitude: "13"; pop_density: "3.54"; } + ListElement{ longitude: "22"; latitude: "13"; pop_density: "1.65"; } + ListElement{ longitude: "23"; latitude: "13"; pop_density: "2.67"; } + } } //! [3] //! [7] ItemModelBarDataProxy { - itemModel: model // E.g. a list model defined elsewhere containing monthly expenses data. + itemModel: model // E.g. a list model defined elsewhere containing yearly expenses data. // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" diff --git a/src/datavisualization/doc/src/qtdatavisualization-qml-bars3d.qdoc b/src/datavisualization/doc/src/qtdatavisualization-qml-bars3d.qdoc index fc1b732c..edeb5530 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-qml-bars3d.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-qml-bars3d.qdoc @@ -36,6 +36,11 @@ * * See \l{Qt Quick 2 Bars Example} for more thorough usage example. * + * \note Qt Data Visualization graphs are rendered behind any other QML elements on screen, including + * the parent elements of the graph. To make the whole graph show, ensure that no other element + * draws anything over the area the graph occupies. For example, having a non-transparent \c Rectangle + * item as the parent of a graph causes the graph to be hidden. + * * \sa Bar3DSeries, ItemModelBarDataProxy, Scatter3D, Surface3D, {Qt Data Visualization C++ Classes} */ @@ -83,6 +88,7 @@ /*! * \qmlproperty list<QBar3DSeries> Bars3D::seriesList + * \default * This property holds the series of the graph. * By default, this property contains an empty list. * To set the series, either use the addSeries() function or define them as children of the graph. diff --git a/src/datavisualization/doc/src/qtdatavisualization-qml-scatter3d.qdoc b/src/datavisualization/doc/src/qtdatavisualization-qml-scatter3d.qdoc index 1f04424f..0a8e1674 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-qml-scatter3d.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-qml-scatter3d.qdoc @@ -36,6 +36,11 @@ See \l{Qt Quick 2 Scatter Example} for more thorough usage example. + \note Qt Data Visualization graphs are rendered behind any other QML elements on screen, including + the parent elements of the graph. To make the whole graph show, ensure that no other element + draws anything over the area the graph occupies. For example, having a non-transparent \c Rectangle + item as the parent of a graph causes the graph to be hidden. + \sa Scatter3DSeries, ScatterDataProxy, Bars3D, Surface3D, {Qt Data Visualization C++ Classes} */ @@ -68,6 +73,7 @@ /*! * \qmlproperty list<QScatter3DSeries> Scatter3D::seriesList + * \default * This property holds the series of the graph. * By default, this property contains an empty list. * To set the series, either use the addSeries() function or define them as children of the graph. diff --git a/src/datavisualization/doc/src/qtdatavisualization-qml-surface3d.qdoc b/src/datavisualization/doc/src/qtdatavisualization-qml-surface3d.qdoc index a3886008..b28d30a7 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-qml-surface3d.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-qml-surface3d.qdoc @@ -36,6 +36,11 @@ See \l{Qt Quick 2 Surface Example} for more thorough usage example. + \note Qt Data Visualization graphs are rendered behind any other QML elements on screen, including + the parent elements of the graph. To make the whole graph show, ensure that no other element + draws anything over the area the graph occupies. For example, having a non-transparent \c Rectangle + item as the parent of a graph causes the graph to be hidden. + \sa Surface3DSeries, ItemModelSurfaceDataProxy, Bars3D, Scatter3D, {Qt Data Visualization C++ Classes} */ @@ -74,6 +79,7 @@ /*! * \qmlproperty list<QSurface3DSeries> Surface3D::seriesList + * \default * This property holds the series of the graph. * By default, this property contains an empty list. * To set the series, either use the addSeries() function or define them as children of the graph. |