RadarData.java
1.32 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
51
52
53
54
55
56
57
58
package com.github.mikephil.charting.data;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.IRadarDataSet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Data container for the RadarChart.
*
* @author Philipp Jahoda
*/
public class RadarData extends ChartData<IRadarDataSet> {
private List<String> mLabels;
public RadarData() {
super();
}
public RadarData(List<IRadarDataSet> dataSets) {
super(dataSets);
}
public RadarData(IRadarDataSet... dataSets) {
super(dataSets);
}
/**
* Sets the labels that should be drawn around the RadarChart at the end of each web line.
*
* @param labels
*/
public void setLabels(List<String> labels) {
this.mLabels = labels;
}
/**
* Sets the labels that should be drawn around the RadarChart at the end of each web line.
*
* @param labels
*/
public void setLabels(String... labels) {
this.mLabels = Arrays.asList(labels);
}
public List<String> getLabels() {
return mLabels;
}
@Override
public Entry getEntryForHighlight(Highlight highlight) {
return getDataSetByIndex(highlight.getDataSetIndex()).getEntryForIndex((int) highlight.getX());
}
}