CandleDataSet<D> class
One series of candles in a candle stick chart. The y range covers the candles' low to high values.
D is the payload type of the entries.
- Inheritance
-
- Object
- BaseDataSet<
CandleEntry< D> > - DataSet<
CandleEntry< D> > - BarLineScatterCandleBubbleDataSet<
CandleEntry< D> > - LineScatterCandleRadarDataSet<
CandleEntry< D> > - CandleDataSet
- Implemented types
Constructors
-
CandleDataSet(List<
CandleEntry< entries, String label)D> > -
Creates a set from
entries, the candles sorted by x (kept by reference, seeDataSet.entries), namedlabel, shown in the legend.
Properties
- axisDependency ↔ AxisDependency
-
The y axis this data set is plotted against. Default AxisDependency.LEFT.
getter/setter pairinherited
- barSpace ↔ double
-
Space left free on each side of a candle as a fraction of the slot width, clamped to 0 to 0.45. Default 0.1.
getter/setter pairoverride-getter
- color ↔ Color
-
The first entry color, or black when colors is empty. Assigning replaces the whole colors list with this one
color.
getter/setter pairinherited
-
colors
↔ List<
Color> -
Colors used to draw the entries, reused from the start when there are more entries than colors.
getter/setter pairinherited
- dashPathEffectHighlight ↔ DashPathEffect?
-
Dash pattern of the highlight lines, or null for solid lines. Set through enableDashedHighlightLine.
getter/setter pairinherited
- decreasingColor ↔ Color
-
Color for candles with close below open. ColorTemplate.COLOR_NONE, the default, uses the entry color from
colors.
getter/setter pairoverride-getter
- decreasingPaintStyle ↔ PaintStyle
-
Whether decreasing bodies are filled or outlined. Default PaintStyle.FILL.
getter/setter pairoverride-getter
-
entries
↔ List<
CandleEntry< D> > -
The entries of this set. The list is kept by reference, so the caller can keep changing it; it must be growable
for addEntry and friends to work. Assigning recomputes the cached ranges; after changing the list in place
call notifyDataSetChanged yourself.
getter/setter pairinherited
- entryCount → int
-
Number of entries in this data set.
no setterinherited
- form ↔ LegendForm
-
Shape of this set's legend entry. LegendForm.DEFAULT uses the legend's form.
getter/setter pairinherited
- formLineDashEffect ↔ DashPathEffect?
-
Dash effect for this set's legend form when the form is a line. Null uses the legend's dash effect.
getter/setter pairinherited
- formLineWidth ↔ double
-
Line width of this set's legend form in dp when the form is a line. NaN uses the legend's width.
getter/setter pairinherited
- formSize ↔ double
-
Size of this set's legend form in dp. NaN (the default) uses the legend's form size.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNonFiniteY ↔ bool
-
True when any entry's y is not a finite number, so a renderer knows the line may need a gap. Set while the
entries are walked, and only cleared by a full calcMinMax; removing the offending entry without one leaves
it true, which costs a check rather than a wrong drawing.
getter/setter pairinherited
- highlightColor ↔ Color
-
Color of the highlight indicator drawn at a selected entry. Default a light orange, rgb(255, 187, 115).
getter/setter pairinherited
- highlightLineWidth ↔ double
-
Width of the highlight indicator lines in dp. Default 0.5 dp.
getter/setter pairinherited
- horizontalHighlightIndicatorSpan ↔ HighlightLineSpan
-
How far the horizontal highlight line reaches. Default HighlightLineSpan.FULL.
getter/setter pairinherited
- iconsOffset ↔ MPPointF
-
Offset in dp applied to every entry icon. Assigning copies x and y into the existing point.
getter/setter pairinherited
- increasingColor ↔ Color
-
Color for candles with close above open. ColorTemplate.COLOR_NONE, the default, uses the entry color from
colors.
getter/setter pairoverride-getter
- increasingPaintStyle ↔ PaintStyle
-
Whether increasing bodies are filled or outlined. Default PaintStyle.STROKE.
getter/setter pairoverride-getter
- isDashedHighlightLineEnabled → bool
-
True while a dash pattern is set for the highlight lines. Default false.
no setterinherited
- isDrawIconsEnabled ↔ bool
-
True to draw the entry icons. Default true. Not drawn when more entries are visible than the chart's
maxVisibleCountallows.getter/setter pairinherited - isDrawValuesEnabled ↔ bool
-
True to draw the value labels at the entries. Default true. Not drawn when more entries are visible
than the chart's
maxVisibleCountallows.getter/setter pairinherited - isHighlightEnabled ↔ bool
-
True if entries of this data set can be highlighted by touch or
chart.highlightValue(...). Default true.getter/setter pairinherited - isHorizontalHighlightIndicatorEnabled ↔ bool
-
True to draw a horizontal line through a highlighted entry. Default true.
getter/setter pairinherited
- isVerticalHighlightIndicatorEnabled ↔ bool
-
True to draw a vertical line through a highlighted entry. Default true.
getter/setter pairinherited
- isVisible ↔ bool
-
True if this data set is drawn. Default true. Hidden data sets still count for the axis ranges.
getter/setter pairinherited
- label ↔ String
-
Name shown in the legend for this data set.
getter/setter pairinherited
- needsFormatter → bool
-
True while no custom valueFormatter is assigned, so the chart may apply its own default formatter.
no setterinherited
- neutralColor ↔ Color
-
Color for candles with open equal to close. ColorTemplate.COLOR_NONE, the default, uses the entry color.
getter/setter pairoverride-getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor ↔ Color
-
Color of the shadow lines when shadowColorSameAsCandle is off. Set ColorTemplate.COLOR_NONE to use
the entry color from colors.
getter/setter pairoverride-getter
- shadowColorSameAsCandle ↔ bool
-
True to draw the shadow line in the body color of its candle instead of shadowColor. Default false.
getter/setter pairoverride-getter
- shadowWidth ↔ double
-
Stroke width of the shadow line between high and low in dp. Default 1.5 dp.
getter/setter pairoverride-getter
- showCandleBar ↔ bool
-
True to draw candle bodies; false draws only the open and close ticks on the shadow line. Default true.
getter/setter pairoverride-getter
- valueFormatter ↔ IValueFormatter
-
Formatter for the value labels. Returns Utils.defaultValueFormatter until a custom one is assigned.
getter/setter pairinherited
- valueTextColor ↔ Color
-
The first value label color, or black when the list is empty. Assigning replaces the whole valueTextColors
list with this one color.
getter/setter pairinherited
-
valueTextColors
↔ List<
Color> -
Colors used to draw the value labels, reused from the start like colors. Default black.
getter/setter pairinherited
- valueTextSize ↔ double
-
Text size of the value labels in dp. Default 7.
getter/setter pairinherited
- valueTypeface ↔ Typeface?
-
Typeface of the value labels, null for the default.
getter/setter pairinherited
- verticalHighlightIndicatorSpan ↔ HighlightLineSpan
-
How far the vertical highlight line reaches. Default HighlightLineSpan.FULL.
getter/setter pairinherited
- xMax ↔ double
-
Largest x over the entries, or -
Float.MAX_VALUEwhen empty. Refreshed by calcMinMax.getter/setter pairinherited - xMin ↔ double
-
Smallest x over the entries, or
Float.MAX_VALUEwhen empty. Refreshed by calcMinMax.getter/setter pairinherited - yMax ↔ double
-
Largest y over the entries, or -
Float.MAX_VALUEwhen empty. Refreshed by calcMinMax and calcMinMaxY.getter/setter pairinherited - yMin ↔ double
-
Smallest y over the entries, or
Float.MAX_VALUEwhen empty. Refreshed by calcMinMax and calcMinMaxY.getter/setter pairinherited
Methods
-
addColor(
Color color) → void -
Appends one color to colors.
inherited
-
addEntry(
CandleEntry< D> e) → bool -
Appends
eto the end without checking the x order; use addEntryOrdered to keep the entries sorted. The cached ranges are widened to includee.inherited -
addEntryOrdered(
CandleEntry< D> e) → void -
Adds
eso that the entries stay sorted by x: it is appended when its x is not smaller than the last entry's x, otherwise inserted before the first entry with a larger x. The cached ranges are widened to includeewithout a full recalculation.inherited -
calcMinMax(
) → void -
Recomputes xMin, xMax, yMin and yMax from all entries.
inherited
-
calcMinMaxForEntry(
CandleEntry< D> e) → void -
Widens the ranges with the candle's CandleEntry.low and CandleEntry.high instead of its y.
override
-
calcMinMaxX(
CandleEntry< D> e) → void -
Widens xMin and xMax to include the x of
e.inherited -
calcMinMaxY(
double fromX, double toX) → void -
Recomputes only yMin and yMax from the entries between
fromXandtoX, used by charts that auto scale the y axis to the visible x range. The x range is left untouched. With no entries in the range the y range is reset to its empty values.inherited -
calcMinMaxYForEntry(
CandleEntry< D> e) → void -
Widens the y range with the candle's CandleEntry.low and CandleEntry.high instead of its y; a candle with a
NaN or infinite low or high is left out.
override
-
clear(
) → void -
Removes all entries and resets the cached ranges.
inherited
-
contains(
CandleEntry< D> entry) → bool -
Returns true if
entryis one of this set's entries, compared with==(identity for Entry).inherited -
copy(
) → DataSet< CandleEntry< D> > -
Returns a deep copy: the entries are copied with Entry.copy, the styling as in BaseDataSet.copyTo.
override
-
copyTo(
covariant CandleDataSet< D> candleDataSet) → void -
Copies the styling from this set into
candleDataSet; entries are not copied here.override -
disableDashedHighlightLine(
) → void -
Draws the highlight lines solid again.
inherited
-
enableDashedHighlightLine(
double lineLength, double spaceLength, double phase) → void -
Draws the highlight lines dashed, like "- - - -".
inherited
-
getColor(
int index) → Color -
Returns the color for the entry at
index, wrapping around colors when there are fewer colors. Black when colors is empty.inherited -
getEntriesForXValue(
double xValue) → List< CandleEntry< D> > -
Returns all entries whose x equals
xValueexactly, in list order, found by binary search over the x sorted entries. Empty when there is no exact match.inherited -
getEntryForIndex(
int index) → CandleEntry< D> -
Returns the entry at
index.inherited -
getEntryForXValue(
double xValue, [double closestToY = double.nan, Rounding rounding = Rounding.CLOSEST]) → CandleEntry< D> ? -
Returns the entry at the index found by getEntryIndex with the same arguments, or null when the set
is empty. The x need not match exactly; see getEntryIndex.
inherited
-
getEntryIndex(
double xValue, [double closestToY = double.nan, Rounding rounding = Rounding.CLOSEST]) → int -
Finds the index of the entry nearest to
xValueby binary search; the entries must be sorted by x. When two entries are equally close, the one with the larger x is taken.inherited -
getEntryIndexOf(
Entry e) → int -
Returns the index of
ein the entries, or -1 when the set does not hold it. Matching is by identity, so an entry with the same x and y asebut built separately is not a match.inherited -
getIndexInEntries(
int xIndex) → int -
Finds the entry whose x equals
xIndexexactly by scanning all entries.inherited -
getValueTextColor(
int index) → Color -
Returns the value label color for the entry at
index, wrapping around valueTextColors. Black when the list is empty.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyDataSetChanged(
) → void -
Recomputes the cached x and y ranges from the entries. Call after changing entries in place.
inherited
-
removeEntry(
CandleEntry< D> e) → bool -
Removes
e, matched with==(identity for Entry), and recomputes the ranges if it was found.inherited -
removeEntryByIndex(
int index) → bool -
Removes the entry at
index.inherited -
removeEntryByXValue(
double xValue) → bool -
Removes the entry whose x is closest to
xValue, which need not be an exact match.inherited -
removeFirst(
) → bool -
Removes the first entry. Returns false and does nothing when the set is empty.
inherited
-
removeLast(
) → bool -
Removes the last entry. Returns false and does nothing when the set is empty.
inherited
-
resetColors(
) → void -
Removes all colors. Add at least one color before the set is drawn; until then getColor returns black.
inherited
-
setColor(
Color color, int alpha) → void -
Replaces colors with this one color after applying
alpha.inherited -
setColors(
List< Color> colors, [int? alpha]) → void -
Replaces
colorswith the given colors (Kotlin'ssetColors(vararg colors: Int)), or, withalpha, with the given colors after applyingalpha(0 transparent to 255 opaque) to each of them, ignoring their own alpha (Kotlin'ssetColors(colors: List<Int>, alpha: Int)).inherited -
setDrawHighlightIndicators(
bool enabled) → void -
Turns both the vertical and the horizontal highlight line on or off at once.
inherited
-
toSimpleString(
) → String -
Returns the label and the entry count in one line, without listing the entries.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited