Renamed candleDataSet.bodySpace -> barSpace
This commit is contained in:
parent
b8f3d49b11
commit
32fc58d8dd
5 changed files with 18 additions and 18 deletions
|
@ -154,7 +154,7 @@ public class CombinedChartActivity extends DemoBase {
|
|||
|
||||
CandleDataSet set = new CandleDataSet(entries, "Candle DataSet");
|
||||
set.setColor(Color.rgb(80, 80, 80));
|
||||
set.setBodySpace(0.3f);
|
||||
set.setBarSpace(0.3f);
|
||||
set.setValueTextSize(10f);
|
||||
set.setDrawValues(false);
|
||||
d.addDataSet(set);
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CandleDataSet extends LineScatterCandleRadarDataSet<CandleEntry> im
|
|||
/**
|
||||
* the space between the candle entries, default 0.1f (10%)
|
||||
*/
|
||||
private float mBodySpace = 0.1f;
|
||||
private float mBarSpace = 0.1f;
|
||||
|
||||
/**
|
||||
* use candle color for the shadow
|
||||
|
@ -90,7 +90,7 @@ public class CandleDataSet extends LineScatterCandleRadarDataSet<CandleEntry> im
|
|||
copied.mColors = mColors;
|
||||
copied.mShadowWidth = mShadowWidth;
|
||||
copied.mShowCandleBar = mShowCandleBar;
|
||||
copied.mBodySpace = mBodySpace;
|
||||
copied.mBarSpace = mBarSpace;
|
||||
copied.mHighLightColor = mHighLightColor;
|
||||
copied.mIncreasingPaintStyle = mIncreasingPaintStyle;
|
||||
copied.mDecreasingPaintStyle = mDecreasingPaintStyle;
|
||||
|
@ -137,19 +137,19 @@ public class CandleDataSet extends LineScatterCandleRadarDataSet<CandleEntry> im
|
|||
*
|
||||
* @param space
|
||||
*/
|
||||
public void setBodySpace(float space) {
|
||||
public void setBarSpace(float space) {
|
||||
|
||||
if (space < 0f)
|
||||
space = 0f;
|
||||
if (space > 0.45f)
|
||||
space = 0.45f;
|
||||
|
||||
mBodySpace = space;
|
||||
mBarSpace = space;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBodySpace() {
|
||||
return mBodySpace;
|
||||
public float getBarSpace() {
|
||||
return mBarSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RealmCandleDataSet<T extends RealmObject> extends RealmLineScatterC
|
|||
/**
|
||||
* the space between the candle entries, default 0.1f (10%)
|
||||
*/
|
||||
private float mBodySpace = 0.1f;
|
||||
private float mBarSpace = 0.1f;
|
||||
|
||||
/**
|
||||
* use candle color for the shadow
|
||||
|
@ -181,19 +181,19 @@ public class RealmCandleDataSet<T extends RealmObject> extends RealmLineScatterC
|
|||
*
|
||||
* @param space
|
||||
*/
|
||||
public void setBodySpace(float space) {
|
||||
public void setBarSpace(float space) {
|
||||
|
||||
if (space < 0f)
|
||||
space = 0f;
|
||||
if (space > 0.45f)
|
||||
space = 0.45f;
|
||||
|
||||
mBodySpace = space;
|
||||
mBarSpace = space;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBodySpace() {
|
||||
return mBodySpace;
|
||||
public float getBarSpace() {
|
||||
return mBarSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ public interface ICandleDataSet extends ILineScatterCandleRadarDataSet<CandleEnt
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
float getBodySpace();
|
||||
float getBarSpace();
|
||||
|
||||
/**
|
||||
* Returns whether the candle bars should show?
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CandleStickChartRenderer extends LineScatterCandleRadarRenderer {
|
|||
|
||||
float phaseX = mAnimator.getPhaseX();
|
||||
float phaseY = mAnimator.getPhaseY();
|
||||
float bodySpace = dataSet.getBodySpace();
|
||||
float barSpace = dataSet.getBarSpace();
|
||||
boolean showCandleBar = dataSet.getShowCandleBar();
|
||||
|
||||
int minx = Math.max(mMinX, 0);
|
||||
|
@ -149,9 +149,9 @@ public class CandleStickChartRenderer extends LineScatterCandleRadarRenderer {
|
|||
|
||||
// calculate the body
|
||||
|
||||
mBodyBuffers[0] = xIndex - 0.5f + bodySpace;
|
||||
mBodyBuffers[0] = xIndex - 0.5f + barSpace;
|
||||
mBodyBuffers[1] = close * phaseY;
|
||||
mBodyBuffers[2] = (xIndex + 0.5f - bodySpace);
|
||||
mBodyBuffers[2] = (xIndex + 0.5f - barSpace);
|
||||
mBodyBuffers[3] = open * phaseY;
|
||||
|
||||
trans.pointValuesToPixel(mBodyBuffers);
|
||||
|
@ -206,12 +206,12 @@ public class CandleStickChartRenderer extends LineScatterCandleRadarRenderer {
|
|||
mRangeBuffers[2] = xIndex;
|
||||
mRangeBuffers[3] = low * phaseY;
|
||||
|
||||
mOpenBuffers[0] = xIndex - 0.5f + bodySpace;
|
||||
mOpenBuffers[0] = xIndex - 0.5f + barSpace;
|
||||
mOpenBuffers[1] = open * phaseY;
|
||||
mOpenBuffers[2] = xIndex;
|
||||
mOpenBuffers[3] = open * phaseY;
|
||||
|
||||
mCloseBuffers[0] = xIndex + 0.5f - bodySpace;
|
||||
mCloseBuffers[0] = xIndex + 0.5f - barSpace;
|
||||
mCloseBuffers[1] = close * phaseY;
|
||||
mCloseBuffers[2] = xIndex;
|
||||
mCloseBuffers[3] = close * phaseY;
|
||||
|
|
Loading…
Add table
Reference in a new issue