Represents a series of data as candlesticks. 更多...
导入语句: | import QtCharts 2.2 |
Since: | QtCharts 2.2 |
实例化: | QCandlestickSeries |
继承: | AbstractSeries |
The CandlestickSeries type acts as a container for single candlestick items. Each item is drawn to its own category when using BarCategoryAxis . DateTimeAxis and ValueAxis can be used as an alternative to BarCategoryAxis . In this case, each candlestick item is drawn according to its timestamp value.
注意: The timestamps must be unique within a CandlestickSeries. When using BarCategoryAxis , only the first one of the candlestick items sharing a timestamp is drawn. If the chart includes multiple instances of CandlestickSeries, items from different series sharing a timestamp are drawn to the same category. When using ValueAxis or DateTimeAxis , candlestick items sharing a timestamp will overlap each other.
The following QML shows how to create a simple candlestick chart:
import QtQuick 2.5 import QtCharts 2.2 ChartView { title: "Candlestick Series" width: 400 height: 300 CandlestickSeries { name: "Acme Ltd." increasingColor: "green" decreasingColor: "red" CandlestickSet { timestamp: 1435708800000; open: 690; high: 694; low: 599; close: 660 } CandlestickSet { timestamp: 1435795200000; open: 669; high: 669; low: 669; close: 669 } CandlestickSet { timestamp: 1436140800000; open: 485; high: 623; low: 485; close: 600 } CandlestickSet { timestamp: 1436227200000; open: 589; high: 615; low: 377; close: 569 } CandlestickSet { timestamp: 1436313600000; open: 464; high: 464; low: 254; close: 254 } } }
另请参阅 CandlestickSet , BarCategoryAxis , DateTimeAxis ,和 ValueAxis .
axisX : AbstractAxis |
The x-axis used for the series. If you leave both axisX and axisXTop undefined, a value axis is created for the series.
axisXTop : AbstractAxis |
The x-axis used for the series, drawn on top of the chart view.
注意: You can only provide either axisX or axisXTop, not both.
另请参阅 axisX .
axisY : AbstractAxis |
The y-axis used for the series. If you leave both axisY and axisYRight undefined, a value axis is created for the series.
另请参阅 axisYRight and ValueAxis .
axisYRight : AbstractAxis |
The y-axis used for the series, drawn to the right on the chart view.
注意: You can only provide either axisY or axisYRight, not both.
另请参阅 axisY .
bodyOutlineVisible : bool |
The visibility of the candlestick body outlines.
bodyWidth : real |
The relative width of the candlestick item within its own slot, in the range from 0.0 to 1.0. Values outside this range are clamped to 0.0 or 1.0.
brushFilename : string |
The name of the file used as a brush image for the series.
capsVisible : bool |
The visibility of the caps.
capsWidth : real |
The relative width of the caps within a candlestick, in the range from 0.0 to 1.0. Values outside this range are clamped to 0.0 or 1.0.
count : int |
The number of candlestick items in a series.
decreasingColor : color |
The color of the decreasing candlestick item body. A candlestick is decreasing when its open value is higher than the close value. By default, this property is set to the brush color with the alpha channel set to 128. The default color is used also when the property is set to an invalid color value.
increasingColor : color |
The color of the increasing candlestick item body. A candlestick is increasing when its close value is higher than the open value. By default, this property is set to the brush color. The default color is used also when the property is set to an invalid color value.
maximumColumnWidth : real |
The maximum width of the candlestick items in pixels. Setting a negative value means there is no maximum width. All negative values are converted to -1.0.
minimumColumnWidth : real |
The minimum width of the candlestick items in pixels. Setting a negative value means there is no minimum width. All negative values are converted to -1.0.
candlestickSetsAdded ( list < CandlestickSet > sets ) |
This signal is emitted when the candlestick items specified by sets are added to the series.
The corresponding signal handler is
onCandlestickSetsAdded
.
注意:
相应处理程序是
onCandlestickSetsAdded
.
candlestickSetsRemoved ( list < CandlestickSet > sets ) |
This signal is emitted when the candlestick items specified by sets are removed from the series.
The corresponding signal handler is
onCandlestickSetsRemoved
.
注意:
相应处理程序是
onCandlestickSetsRemoved
.
clicked ( CandlestickSet set ) |
This signal is emitted when the candlestick item specified by set is clicked on the chart.
The corresponding signal handler is
onClicked
.
注意:
相应处理程序是
onClicked
.
doubleClicked ( CandlestickSet set ) |
This signal is emitted when the candlestick item specified by set is double-clicked on the chart.
The corresponding signal handler is
onDoubleClicked
.
注意:
相应处理程序是
onDoubleClicked
.
hovered ( bool status , CandlestickSet set ) |
This signal is emitted when a mouse is hovered over the candlestick item specified by set in a chart.
When the mouse moves over the item,
status
turns
true
, and when the mouse moves away again, it turns
false
.
The corresponding signal handler is
onHovered
.
注意:
相应处理程序是
onHovered
.
pressed ( CandlestickSet set ) |
This signal is emitted when the user clicks the candlestick item specified by set and holds down the mouse button.
The corresponding signal handler is
onPressed
.
注意:
相应处理程序是
onPressed
.
released ( CandlestickSet set ) |
This signal is emitted when the user releases the mouse press on the candlestick item specified by set .
The corresponding signal handler is
onReleased
.
注意:
相应处理程序是
onReleased
.
append ( CandlestickSet set ) |
Adds a single candlestick item specified by set to the series and takes ownership of it. If the item is null or it is already in the series, it is not appended.
返回
true
if appending succeeded,
false
否则。
at ( int index ) |
Returns the candlestick item at the position specified by index . Returns null if the index is not valid.
clear () |
Removes all candlestick items from the series and permanently deletes them.
insert ( int index , CandlestickSet set ) |
Inserts the candlestick item specified by set to the series at the position specified by index . Takes ownership of the item. If the item is null or already belongs to the series, it is not inserted.
返回
true
if inserting succeeded,
false
否则。
remove ( CandlestickSet set ) |
Removes a single candlestick item, specified by set , from the series.
返回
true
if the item is successfully deleted,
false
否则。