forked from PhilJay/MPAndroidChart
-
Notifications
You must be signed in to change notification settings - Fork 0
DataSet classes in detail
Philipp Jahoda edited this page Mar 29, 2015
·
20 revisions
This wiki entry focuses on the subclasses of the DataSet class.
All other subclasses of DataSet not mentioned here do not provide any specific enhancements.
Line-, Bar-, Scatter- & CandleDataSet (below mentioned methods can be used for any of the mentioned DataSet classes)
-
setHighLightColor(int color): Sets the color that is used for drawing the highlight indicators. Don't forget to resolve the color usinggetResources().getColor(...)orColor.rgb(...)(or simplyColor.BLACK).
Line- & RadarDataSet (methods only for LineDataSet and RadarDataSet)
-
setFillColor(int color): Sets the color that is used for filling the line surface. -
setFillAlpha(int alpha): Sets the alpha value (transparency) that is used for filling the line surface (0-255), default: 85, 255 = fully opaque, 0 = fully transparent -
setDrawFilled(boolean filled): Set to true if the DataSet should be drawn filled (surface, area), and not just as a line, disabling this will give great performance boost! default: false -
setLineWidth(float width): Set the line width for this DataSet (min = 0.2f, max = 10f); default 1f NOTE: thinner line == better performance, thicker line == worse performance
Below mentioned methods are only applicable for the specifically mentioned DataSet subclass.
LineDataSet (class LineDataSet)
-
setCircleSize(float size): Sets the size (radius) of the circle shaped value indicators, default size = 4f -
setDrawCircles(boolean enabled): Set this to true to enable the drawing of circle indicators for thisLineDataSet, default true -
setDrawCubic(boolean enabled): If set to true, the linechart lines are drawn in cubic-style instead of linear. This has a negative effect on performance! Default: false -
setCubicIntensity(float intensity): Sets the intensity for cubic lines (if enabled). Max = 1f = very cubic, Min = 0.05f = low cubic effect, Default: 0.2f -
setCircleColor(int color): Sets the color all circle indicators of this dataset should have. -
setCircleColors(List colors): Sets the colors the outer-circles of thisLineDataSetshould have. There are various other methods for setting circle colors as well. -
setCircleColorHole(int color): Sets the color of the inner circle of the line-circles (the hole). -
setDrawCircleHole(boolean enabled): Set this to true to allow drawing a hole in each circle of this dataset. If set to false, circles will be drawn filled (without hole). -
enableDashedLine(float lineLength, float spaceLength, float phase): Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -". "lineLength" is the length of the line pieces, "spaceLength" is the length of space in between the pieces, "phase" is the offset, in degrees (normally, use 0)
BarDataSet (class BarDataSet)
-
setBarSpacePercent(float percent): Sets the space between the bars in percent of the total bar width. -
setBarShadowColor(int color): Sets the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value. Don't for get to usegetResources().getColor(...)to set this. OrColor.rgb(...). -
setHighLightAlpha(int alpha): Set the alpha value (transparency) that is used for drawing the highlight indicator bar. min = 0 (fully transparent), max = 255 (fully opaque). -
setStackLabels(String[] labels): Sets labels for different values of bar-stacks, in case there are one.