Example adjustments
This commit is contained in:
parent
9297923f09
commit
8703a0b886
12 changed files with 20 additions and 3 deletions
|
@ -96,6 +96,7 @@ public class BarChartActivity extends DemoBase implements OnSeekBarChangeListene
|
|||
leftAxis.setValueFormatter(custom);
|
||||
leftAxis.setPosition(YAxisLabelPosition.OUTSIDE_CHART);
|
||||
leftAxis.setSpaceTop(15f);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
YAxis rightAxis = mChart.getAxisRight();
|
||||
rightAxis.setDrawGridLines(false);
|
||||
|
@ -103,6 +104,7 @@ public class BarChartActivity extends DemoBase implements OnSeekBarChangeListene
|
|||
rightAxis.setLabelCount(8, false);
|
||||
rightAxis.setValueFormatter(custom);
|
||||
rightAxis.setSpaceTop(15f);
|
||||
rightAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
Legend l = mChart.getLegend();
|
||||
l.setPosition(LegendPosition.BELOW_CHART_LEFT);
|
||||
|
@ -244,7 +246,7 @@ public class BarChartActivity extends DemoBase implements OnSeekBarChangeListene
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
float mult = (range + 1);
|
||||
float val = -10; //(float) (Math.random() * mult);
|
||||
float val = (float) (Math.random() * mult);
|
||||
yVals1.add(new BarEntry(val, i));
|
||||
}
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ public class BarChartActivityMultiDataset extends DemoBase implements OnSeekBarC
|
|||
leftAxis.setValueFormatter(new LargeValueFormatter());
|
||||
leftAxis.setDrawGridLines(false);
|
||||
leftAxis.setSpaceTop(30f);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ public class BubbleChartActivity extends DemoBase implements OnSeekBarChangeList
|
|||
yl.setTypeface(tf);
|
||||
yl.setSpaceTop(30f);
|
||||
yl.setSpaceBottom(30f);
|
||||
yl.setDrawZeroLine(false);
|
||||
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
|
||||
|
|
|
@ -58,9 +58,11 @@ public class CombinedChartActivity extends DemoBase {
|
|||
|
||||
YAxis rightAxis = mChart.getAxisRight();
|
||||
rightAxis.setDrawGridLines(false);
|
||||
rightAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
YAxis leftAxis = mChart.getAxisLeft();
|
||||
leftAxis.setDrawGridLines(false);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
XAxis xAxis = mChart.getXAxis();
|
||||
xAxis.setPosition(XAxisPosition.BOTH_SIDED);
|
||||
|
|
|
@ -97,12 +97,14 @@ public class HorizontalBarChartActivity extends DemoBase implements OnSeekBarCha
|
|||
yl.setDrawAxisLine(true);
|
||||
yl.setDrawGridLines(true);
|
||||
yl.setGridLineWidth(0.3f);
|
||||
yl.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
// yl.setInverted(true);
|
||||
|
||||
YAxis yr = mChart.getAxisRight();
|
||||
yr.setTypeface(tf);
|
||||
yr.setDrawAxisLine(true);
|
||||
yr.setDrawGridLines(false);
|
||||
yr.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
// yr.setInverted(true);
|
||||
|
||||
setData(12, 50);
|
||||
|
|
|
@ -88,6 +88,7 @@ public class InvertedLineChartActivity extends DemoBase implements OnSeekBarChan
|
|||
|
||||
YAxis leftAxis = mChart.getAxisLeft();
|
||||
leftAxis.setInverted(true);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
YAxis rightAxis = mChart.getAxisRight();
|
||||
rightAxis.setEnabled(false);
|
||||
|
|
|
@ -84,6 +84,7 @@ public class ScatterChartActivity extends DemoBase implements OnSeekBarChangeLis
|
|||
|
||||
YAxis yl = mChart.getAxisLeft();
|
||||
yl.setTypeface(tf);
|
||||
yl.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
|
||||
|
|
|
@ -72,8 +72,9 @@ public class StackedBarActivity extends DemoBase implements OnSeekBarChangeListe
|
|||
mChart.setDrawValueAboveBar(false);
|
||||
|
||||
// change the position of the y-labels
|
||||
YAxis yLabels = mChart.getAxisLeft();
|
||||
yLabels.setValueFormatter(new MyYAxisValueFormatter());
|
||||
YAxis leftAxis = mChart.getAxisLeft();
|
||||
leftAxis.setValueFormatter(new MyYAxisValueFormatter());
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
|
||||
XAxis xLabels = mChart.getXAxis();
|
||||
|
|
|
@ -52,6 +52,7 @@ public class BarChartFrag extends SimpleFragment implements OnChartGestureListen
|
|||
|
||||
YAxis leftAxis = mChart.getAxisLeft();
|
||||
leftAxis.setTypeface(tf);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ public class ComplexityFragment extends SimpleFragment {
|
|||
|
||||
YAxis leftAxis = mChart.getAxisLeft();
|
||||
leftAxis.setTypeface(tf);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
|
||||
|
|
|
@ -62,11 +62,13 @@ public class BarChartItem extends ChartItem {
|
|||
leftAxis.setTypeface(mTf);
|
||||
leftAxis.setLabelCount(5, false);
|
||||
leftAxis.setSpaceTop(20f);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
YAxis rightAxis = holder.chart.getAxisRight();
|
||||
rightAxis.setTypeface(mTf);
|
||||
rightAxis.setLabelCount(5, false);
|
||||
rightAxis.setSpaceTop(20f);
|
||||
rightAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
mChartData.setValueTypeface(mTf);
|
||||
|
||||
|
|
|
@ -62,11 +62,13 @@ public class LineChartItem extends ChartItem {
|
|||
YAxis leftAxis = holder.chart.getAxisLeft();
|
||||
leftAxis.setTypeface(mTf);
|
||||
leftAxis.setLabelCount(5, false);
|
||||
leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
YAxis rightAxis = holder.chart.getAxisRight();
|
||||
rightAxis.setTypeface(mTf);
|
||||
rightAxis.setLabelCount(5, false);
|
||||
rightAxis.setDrawGridLines(false);
|
||||
rightAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)
|
||||
|
||||
// set data
|
||||
holder.chart.setData((LineData) mChartData);
|
||||
|
|
Loading…
Add table
Reference in a new issue