Fix compile errors in example project
This commit is contained in:
parent
3a451e238b
commit
98f375f9f9
5 changed files with 25 additions and 15 deletions
|
@ -24,6 +24,7 @@ import com.github.mikephil.charting.data.DataSet;
|
|||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.data.PieData;
|
||||
import com.github.mikephil.charting.data.PieDataSet;
|
||||
import com.github.mikephil.charting.interfaces.datainterfaces.datasets.IDataSet;
|
||||
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
|
||||
import com.github.mikephil.charting.utils.ColorTemplate;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
|
@ -116,7 +117,7 @@ public class PieChartActivity extends DemoBase implements OnSeekBarChangeListene
|
|||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.actionToggleValues: {
|
||||
for (DataSet<?> set : mChart.getData().getDataSets())
|
||||
for (IDataSet<?> set : mChart.getData().getDataSets())
|
||||
set.setDrawValues(!set.isDrawValuesEnabled());
|
||||
|
||||
mChart.invalidate();
|
||||
|
|
|
@ -14,10 +14,11 @@ import com.github.mikephil.charting.components.Legend;
|
|||
import com.github.mikephil.charting.components.Legend.LegendPosition;
|
||||
import com.github.mikephil.charting.components.XAxis;
|
||||
import com.github.mikephil.charting.components.YAxis;
|
||||
import com.github.mikephil.charting.data.DataSet;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.data.RadarData;
|
||||
import com.github.mikephil.charting.data.RadarDataSet;
|
||||
import com.github.mikephil.charting.interfaces.datainterfaces.datasets.IDataSet;
|
||||
import com.github.mikephil.charting.interfaces.datainterfaces.datasets.IRadarDataSet;
|
||||
import com.github.mikephil.charting.utils.ColorTemplate;
|
||||
import com.xxmassdeveloper.mpchartexample.custom.MyMarkerView;
|
||||
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;
|
||||
|
@ -83,14 +84,14 @@ public class RadarChartActivitry extends DemoBase {
|
|||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.actionToggleValues: {
|
||||
for (DataSet<?> set : mChart.getData().getDataSets())
|
||||
for (IDataSet<?> set : mChart.getData().getDataSets())
|
||||
set.setDrawValues(!set.isDrawValuesEnabled());
|
||||
|
||||
mChart.invalidate();
|
||||
break;
|
||||
}
|
||||
case R.id.actionToggleHighlight: {
|
||||
if(mChart.getData() != null) {
|
||||
if (mChart.getData() != null) {
|
||||
mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
|
||||
mChart.invalidate();
|
||||
}
|
||||
|
@ -106,10 +107,10 @@ public class RadarChartActivitry extends DemoBase {
|
|||
}
|
||||
case R.id.actionToggleFilled: {
|
||||
|
||||
ArrayList<RadarDataSet> sets = (ArrayList<RadarDataSet>) mChart.getData()
|
||||
ArrayList<IRadarDataSet> sets = (ArrayList<IRadarDataSet>) mChart.getData()
|
||||
.getDataSets();
|
||||
|
||||
for (RadarDataSet set : sets) {
|
||||
for (IRadarDataSet set : sets) {
|
||||
if (set.isDrawFilledEnabled())
|
||||
set.setDrawFilled(false);
|
||||
else
|
||||
|
@ -147,7 +148,7 @@ public class RadarChartActivitry extends DemoBase {
|
|||
return true;
|
||||
}
|
||||
|
||||
private String[] mParties = new String[] {
|
||||
private String[] mParties = new String[]{
|
||||
"Party A", "Party B", "Party C", "Party D", "Party E", "Party F", "Party G", "Party H",
|
||||
"Party I"
|
||||
};
|
||||
|
@ -186,7 +187,7 @@ public class RadarChartActivitry extends DemoBase {
|
|||
set2.setDrawFilled(true);
|
||||
set2.setLineWidth(2f);
|
||||
|
||||
ArrayList<RadarDataSet> sets = new ArrayList<RadarDataSet>();
|
||||
ArrayList<IRadarDataSet> sets = new ArrayList<IRadarDataSet>();
|
||||
sets.add(set1);
|
||||
sets.add(set2);
|
||||
|
||||
|
|
|
@ -81,13 +81,7 @@ public abstract class LineRadarDataSet<T extends Entry> extends LineScatterCandl
|
|||
return mLineWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true if the DataSet should be drawn filled (surface), and not just
|
||||
* as a line, disabling this will give great performance boost! default:
|
||||
* false
|
||||
*
|
||||
* @param filled
|
||||
*/
|
||||
@Override
|
||||
public void setDrawFilled(boolean filled) {
|
||||
mDrawFilled = filled;
|
||||
}
|
||||
|
|
|
@ -115,6 +115,11 @@ public class RealmLineDataSet<T extends RealmObject> extends BaseDataSet<Entry>
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDrawFilled(boolean enabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVerticalHighlightIndicatorEnabled() {
|
||||
return false;
|
||||
|
|
|
@ -35,4 +35,13 @@ public interface ILineRadarDataSet<T extends Entry> extends ILineScatterCandleRa
|
|||
* @return
|
||||
*/
|
||||
boolean isDrawFilledEnabled();
|
||||
|
||||
/**
|
||||
* Set to true if the DataSet should be drawn filled (surface), and not just
|
||||
* as a line, disabling this will give great performance boost! default:
|
||||
* false
|
||||
*
|
||||
* @param enabled
|
||||
*/
|
||||
void setDrawFilled(boolean enabled);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue