forked from PhilJay/MPAndroidChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCandleStickChart.java
More file actions
50 lines (38 loc) · 1.22 KB
/
CandleStickChart.java
File metadata and controls
50 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.github.mikephil.charting.charts;
import android.content.Context;
import android.util.AttributeSet;
import com.github.mikephil.charting.data.CandleData;
import com.github.mikephil.charting.interfaces.CandleDataProvider;
import com.github.mikephil.charting.renderer.CandleStickChartRenderer;
/**
* Financial chart type that draws candle-sticks (OHCL chart).
*
* @author Philipp Jahoda
*/
public class CandleStickChart extends BarLineChartBase<CandleData> implements CandleDataProvider {
public CandleStickChart(Context context) {
super(context);
}
public CandleStickChart(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CandleStickChart(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void init() {
super.init();
mRenderer = new CandleStickChartRenderer(this, mAnimator, mViewPortHandler);
mXChartMin = -0.5f;
}
@Override
protected void calcMinMax() {
super.calcMinMax();
mXChartMax += 0.5f;
mDeltaX = Math.abs(mXChartMax - mXChartMin);
}
@Override
public CandleData getCandleData() {
return mData;
}
}