Surface3D QML Type

Describes the usage of the 3D surface graph. 更多...

import 语句: import QtDataVisualization 1.7
Since: QtDataVisualization 1.0
继承:

AbstractGraph3D

特性

方法

详细描述

This type enables developers to render surface plots in 3D with Qt Quick.

You will need to import the data visualization module to use this type:

import QtDataVisualization 1.2
					

After that you can use Surface3D in your qml files:

import QtQuick 2.0
import QtDataVisualization 1.2
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"
                yPosRole: "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"; }
    }
}
					

Surface Graph Gallery for more thorough usage example.

另请参阅 Surface3DSeries , ItemModelSurfaceDataProxy , Bars3D , Scatter3D ,和 Qt Data Visualization C++ 类 .

特性文档编制

axisX : ValueAxis3D

The active x-axis.

If an axis is not given, a temporary default axis with no labels and an automatically adjusting range is created. This temporary axis is destroyed if another axis is explicitly set to the same orientation.

axisY : ValueAxis3D

The active y-axis.

If an axis is not given, a temporary default axis with no labels and an automatically adjusting range is created. This temporary axis is destroyed if another axis is explicitly set to the same orientation.

axisZ : ValueAxis3D

The active z-axis.

If an axis is not given, a temporary default axis with no labels and an automatically adjusting range is created. This temporary axis is destroyed if another axis is explicitly set to the same orientation.

flipHorizontalGrid : bool [since QtDataVisualization 1.2]

In some use cases the horizontal axis grid is mostly covered by the surface, so it can be more useful to display the horizontal axis grid on top of the graph rather than on the bottom. A typical use case for this is showing 2D spectrograms using orthoGraphic projection with a top-down viewpoint.

false , the horizontal axis grid and labels are drawn on the horizontal background of the graph. If true , the horizontal axis grid and labels are drawn on the opposite side of the graph from the horizontal background. Defaults to false .

该特性在 QtDataVisualization 1.2 引入。

selectedSeries : Surface3DSeries

The selected series or null. If selectionMode 拥有 SelectionMultiSeries flag set, this property holds the series which owns the selected point.

seriesList : list < Surface3DSeries > [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.

方法文档编制

void addSeries ( Surface3DSeries series )

添加 series to the graph.

另请参阅 AbstractGraph3D::hasSeries ().

void removeSeries ( Surface3DSeries series )

移除 series from the graph.

另请参阅 AbstractGraph3D::hasSeries ().