本文整理匯總了Java中com.github.mikephil.charting.components.Legend.setForm方法的典型用法代碼示例。如果您正苦於以下問題:Java Legend.setForm方法的具體用法?Java Legend.setForm怎麽用?Java Legend.setForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.components.Legend
的用法示例。
在下文中一共展示了Legend.setForm方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initTemperatureChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void initTemperatureChart() {
m_barChart.setDrawBarShadow(false);
m_barChart.setDrawValueAboveBar(true);
m_barChart.setDescription("");
m_barChart.setDrawBarShadow(false);
m_barChart.setDrawGridBackground(false);
m_barChart.setTouchEnabled(false);
m_barChart.setScaleXEnabled(false);
m_barChart.setScaleYEnabled(false);
XAxis xAxis = m_barChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawGridLines(false);
xAxis.setSpaceBetweenLabels(1);
Legend l = m_barChart.getLegend();
l.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
l.setForm(Legend.LegendForm.SQUARE);
l.setFormSize(9f);
l.setTextSize(11f);
l.setXEntrySpace(4f);
}
示例2: addData
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void addData() {
ArrayList<PieEntry> yEntrys = new ArrayList<>();
ArrayList<String> xEntrys = new ArrayList<>();
for(int i = 0; i < yData.length; i++){
yEntrys.add(new PieEntry(yData[i] , i));
xEntrys.add(xData[i]);
}
PieDataSet pieDataSet = new PieDataSet(yEntrys, "Category History");
pieDataSet.setSliceSpace(2);
pieDataSet.setValueTextSize(12);
pieDataSet.setValueTextColor(Color.WHITE);
ArrayList<Integer> colors = new ArrayList<>();
colors.add(Color.RED);
colors.add(Color.BLUE);
pieDataSet.setColors(colors);
Legend legend = pieChart.getLegend();
List<LegendEntry> legends = new ArrayList<>();
LegendEntry red = new LegendEntry();
red.label = "Missed";
red.formColor = Color.RED;
legends.add(red);
LegendEntry blue = new LegendEntry();
blue.label = "Completed";
blue.formColor = Color.BLUE;
legends.add(blue);
pieChart.getLegend().setCustom(legends);
legend.setForm(Legend.LegendForm.CIRCLE);
PieData pieData = new PieData(pieDataSet);
pieChart.setData(pieData);
pieChart.invalidate();
pieChart.getDescription().setEnabled(false);
}
示例3: init
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attrs, int defStyle) {
getDescription().setEnabled(false);
LimitLine llXAxis = new LimitLine(10f, "Index 10");
llXAxis.setLineWidth(4f);
llXAxis.enableDashedLine(10f, 10f, 0f);
llXAxis.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM);
llXAxis.setTextSize(10f);
XAxis xAxis = getXAxis();
// xAxis.enableGridDashedLine(10f, 10f, 0f);
xAxis.setDrawGridLines(false);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextColor(Color.GRAY);
LimitLine ll1 = new LimitLine(80f, "Avg");
ll1.setLineWidth(1f);
ll1.enableDashedLine(10f, 10f, 0f);
ll1.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_TOP);
ll1.setTextSize(10f);
YAxis leftAxis = getAxisLeft();
leftAxis.removeAllLimitLines();
leftAxis.addLimitLine(ll1);
leftAxis.setAxisMaximum(160f);
leftAxis.setAxisMinimum(0f);
leftAxis.setDrawGridLines(false);
leftAxis.setDrawZeroLine(false);
leftAxis.setTextColor(Color.GRAY);
leftAxis.setDrawLimitLinesBehindData(true);
getAxisRight().setEnabled(false);
Legend l = getLegend();
l.setForm(Legend.LegendForm.LINE);
}
示例4: initLineChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
/**
* 初始化LineChart
*/
private void initLineChart() {
//設置支持觸控
mBarChart.setTouchEnabled(true); // 設置是否可以觸摸
mBarChart.setDragEnabled(false);// 是否可以拖拽
mBarChart.setScaleEnabled(false);// 是否可以縮放
mBarChart.setBackgroundColor(Color.WHITE);//背景顏色
mBarChart.setDrawGridBackground(false); //網格
mBarChart.setDrawBarShadow(false);//背景陰影
mBarChart.setHighlightFullBarEnabled(false);//設置高光
mBarChart.setDrawBorders(false);//顯示邊界
mBarChart.getXAxis().setDrawGridLines(false);//是否顯示豎直標尺線
mBarChart.getAxisLeft().setDrawGridLines(false);//是否顯示橫直標尺線
mBarChart.getAxisRight().setEnabled(false);//是否顯示最右側豎線
mBarChart.setDescription(null);
//設置動畫效果
mBarChart.animateY(1000, Easing.EasingOption.Linear);
mBarChart.animateX(1000, Easing.EasingOption.Linear);
//折線圖例 標簽 設置
Legend legend = mBarChart.getLegend();
legend.setForm(Legend.LegendForm.LINE);
legend.setTextSize(11f);
//顯示位置
legend.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.LEFT);
legend.setOrientation(Legend.LegendOrientation.HORIZONTAL);
legend.setDrawInside(false);
legend.setEnabled(false);
//XY軸的設置
//X軸設置顯示位置在底部
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setGranularity(1f);
//保證Y軸從0開始,不然會上移一點
leftAxis.setAxisMinimum(0f);
rightAxis.setAxisMinimum(0f);
}
示例5: getFormattedPieChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
/**
* Formats a pie chart in a standardized way
* @param c Context
* @param p Pie chart
* @param shouldShowLegend
* @return the PieChart, whose data must be set and invalidated
*/
public static PieChart getFormattedPieChart(Context c, PieChart p, boolean shouldShowLegend) {
Legend cLegend = p.getLegend();
if (shouldShowLegend) {
cLegend.setEnabled(true);
cLegend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
cLegend.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
cLegend.setOrientation(Legend.LegendOrientation.HORIZONTAL);
cLegend.setDrawInside(false);
cLegend.setForm(Legend.LegendForm.CIRCLE);
cLegend.setTextSize(15);
cLegend.setWordWrapEnabled(true);
} else {
cLegend.setEnabled(false);
}
p.setDrawEntryLabels(false);
p.setDescription(EMPTY_CHART_DESCRIPTION);
p.setHoleRadius(60f);
p.setTransparentCircleRadius(65f);
p.setCenterTextSize(20);
if (SettingsActivity.getTheme(c) == SettingsActivity.THEME_NOIR) {
int colorPrimaryNoir = ContextCompat.getColor(c, R.color.colorPrimaryNoir);
int colorPrimaryTextNoir = ContextCompat.getColor(c, R.color.colorPrimaryTextNoir);
p.setHoleColor(colorPrimaryNoir);
p.setTransparentCircleColor(colorPrimaryNoir);
p.setCenterTextColor(colorPrimaryTextNoir);
cLegend.setTextColor(colorPrimaryTextNoir);
}
p.setRotationEnabled(false);
p.setOnChartValueSelectedListener(new PieChartListener(p));
return p;
}
示例6: initTemperatureChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void initTemperatureChart(LineChart mChart) {
// mChart.setOnChartValueSelectedListener(this);
mChart.setDescription("Skin Temperature");
mChart.setNoDataTextDescription("You need to provide data for the chart.");
mChart.setTouchEnabled(true);
mChart.setDragDecelerationFrictionCoef(0.9f);
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
mChart.setDrawGridBackground(false);
mChart.setHighlightPerDragEnabled(true);
mChart.setPinchZoom(true);
mChart.setBackgroundColor(getResources().getColor(R.color.blue_light_pressed));
mChart.animateX(2500);
Legend l = mChart.getLegend();
l.setForm(Legend.LegendForm.LINE);
l.setTypeface(BandApplication.INSTANCE.getTfLight());
l.setTextSize(11f);
l.setTextColor(Color.WHITE);
l.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
mChart.getXAxis().setEnabled(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(BandApplication.INSTANCE.getTfLight());
leftAxis.setTextColor(Color.RED);
leftAxis.setDrawGridLines(true);
leftAxis.setGranularityEnabled(true);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setTypeface(BandApplication.INSTANCE.getTfLight());
rightAxis.setTextColor(Color.RED);
rightAxis.setDrawGridLines(false);
rightAxis.setDrawZeroLine(false);
rightAxis.setGranularityEnabled(false);
}
示例7: initResistanceChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void initResistanceChart(LineChart mChart) {
// mChart.setOnChartValueSelectedListener(this);
mChart.setDescription("Skin Resistance");
mChart.setNoDataTextDescription("You need to provide data for the chart.");
mChart.setTouchEnabled(true);
mChart.setDragDecelerationFrictionCoef(0.9f);
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
mChart.setDrawGridBackground(false);
mChart.setHighlightPerDragEnabled(true);
mChart.setPinchZoom(true);
mChart.setBackgroundColor(getResources().getColor(R.color.green_pressed));
mChart.animateX(2500);
Legend l = mChart.getLegend();
l.setForm(Legend.LegendForm.LINE);
l.setTypeface(BandApplication.INSTANCE.getTfLight());
l.setTextSize(11f);
l.setTextColor(Color.WHITE);
l.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
mChart.getXAxis().setEnabled(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(BandApplication.INSTANCE.getTfLight());
leftAxis.setTextColor(Color.RED);
leftAxis.setDrawGridLines(true);
leftAxis.setGranularityEnabled(true);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setTypeface(BandApplication.INSTANCE.getTfLight());
rightAxis.setTextColor(Color.RED);
rightAxis.setDrawGridLines(false);
rightAxis.setDrawZeroLine(false);
rightAxis.setGranularityEnabled(false);
}
示例8: setupChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void setupChart() {
mChart.setDrawBarShadow(false);
mChart.setDrawValueAboveBar(true);
mChart.setDescription("");
mChart.setMaxVisibleValueCount(60);
mChart.setPinchZoom(false);
mChart.setDrawGridBackground(false);
XAxis xAxis = mChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawGridLines(false);
xAxis.setSpaceBetweenLabels(2);
YAxisValueFormatter custom = new PercentFormatter();
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setLabelCount(8, false);
leftAxis.setValueFormatter(custom);
leftAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
leftAxis.setSpaceTop(15f);
leftAxis.setAxisMinValue(0f);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setDrawGridLines(false);
rightAxis.setLabelCount(8, false);
rightAxis.setValueFormatter(custom);
rightAxis.setSpaceTop(15f);
rightAxis.setAxisMinValue(0f);
Legend legend = mChart.getLegend();
legend.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
legend.setForm(Legend.LegendForm.CIRCLE);
legend.setFormSize(9f);
legend.setTextSize(11f);
legend.setXEntrySpace(4f);
mChart.animateXY(1000, 1000);
}
示例9: initHumidityChart
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
private void initHumidityChart() {
m_lineChart.setDescription("");
m_lineChart.setBackgroundColor(getResources().getColor(R.color.nothing));
// enable touch gestures
m_lineChart.setTouchEnabled(true);
// enable scaling and dragging
m_lineChart.setDragEnabled(true);
m_lineChart.setScaleEnabled(false);
m_lineChart.setScaleXEnabled(false);
m_lineChart.setScaleYEnabled(false);
m_lineChart.setPinchZoom(false);
m_lineChart.setDrawGridBackground(false);
XAxis x = m_lineChart.getXAxis();
x.setPosition(XAxis.XAxisPosition.BOTTOM);
x.setEnabled(false);
x.setSpaceBetweenLabels(1);
m_lineChart.getAxisRight().setEnabled(false);
Legend l = m_lineChart.getLegend();
l.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
l.setForm(Legend.LegendForm.LINE);
l.setFormSize(9f);
l.setTextSize(11f);
l.setXEntrySpace(4f);
}
示例10: setData
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
/**
* By calling setData initializes the rest of the view
* @param data the chart data
*/
@Override
public void setData(LineData data) {
super.setData(data);
setOnChartValueSelectedListener(this);
setDescription("");
setNoDataTextDescription("No chart data");
setTouchEnabled(true);
setScaleEnabled(true);
setDragEnabled(true);
setDrawGridBackground(true);
setPinchZoom(true);
Legend legend = getLegend();
legend.setForm(Legend.LegendForm.CIRCLE);
legend.setWordWrapEnabled(true);
XAxis xAxis = getXAxis();
xAxis.setAvoidFirstLastClipping(true);
xAxis.setPosition(XAxis.XAxisPosition.TOP);
YAxis yAxisLeft = getAxisLeft();
yAxisLeft.setAxisMinValue(0);
YAxis yAxisRight = getAxisRight();
yAxisRight.setEnabled(false);
}
示例11: setupPie
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void setupPie(PieChart pieChart, int pos, float dados[], String labels[]) {
List<PieEntry> entries = new ArrayList<>();
int index = 0;
for (float dado : dados) {
entries.add(new PieEntry(dado, labels[index]));
index++;
}
//entries.add(new PieEntry(24.0f, "Red"));
//entries.add(new PieEntry(30.8f, "Blue"));
PieDataSet set = new PieDataSet(entries, "");
Description description = new Description();
description.setText(" ");
pieChart.setDescription(description);
set.setColors(ColorTemplate.MATERIAL_COLORS);
PieData data = new PieData(set);
pieChart.setData(data);
pieChart.invalidate();
Legend l = pieChart.getLegend();
l.setFormSize(15f); // set the size of the legend forms/shapes
l.setForm(Legend.LegendForm.CIRCLE); // set what type of form/shape should be used
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
l.setOrientation(Legend.LegendOrientation.VERTICAL);
l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
l.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
l.setTextSize(18f);
l.setTextColor(Color.BLACK);
l.setXEntrySpace(5f); // set the space between the legend entries on the x-axis
l.setYEntrySpace(5f);
pieChart.animateXY(3000, 3000);
}
示例12: addDataSet
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
private void addDataSet() {
Log.d(TAG, "addDataSet started");
ArrayList<PieEntry> yEntrys = new ArrayList<>();
ArrayList<String> xEntrys = new ArrayList<>();
for(int i = 0; i < yData.length; i++){
yEntrys.add(new PieEntry(yData[i] , i));
}
for(int i = 1; i < xData.length; i++){
xEntrys.add(xData[i]);
}
//create the data set
PieDataSet pieDataSet = new PieDataSet(yEntrys, "Төлөвлөгөөний үзүүлэлтлл");
pieDataSet.setSliceSpace(2);
pieDataSet.setValueTextSize(12);
//add colors to dataset
ArrayList<Integer> colors = new ArrayList<>();
colors.add(Color.GRAY);
colors.add(Color.BLUE);
colors.add(Color.RED);
colors.add(Color.GREEN);
colors.add(Color.CYAN);
colors.add(Color.YELLOW);
colors.add(Color.MAGENTA);
pieDataSet.setColors(colors);
//add legend to chart
Legend legend = pieChart.getLegend();
legend.setForm(Legend.LegendForm.CIRCLE);
legend.setPosition(Legend.LegendPosition.LEFT_OF_CHART);
//create pie data object
PieData pieData = new PieData(pieDataSet);
pieChart.setData(pieData);
pieChart.invalidate();
}
示例13: onCreate
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart_sinus);
mSinusData = FileUtils.loadBarEntriesFromAssets(getAssets(), "othersine.txt");
tvX = (TextView) findViewById(R.id.tvValueCount);
mSeekBarX = (SeekBar) findViewById(R.id.seekbarValues);
mChart = (BarChart) findViewById(R.id.chart1);
mChart.setDrawBarShadow(false);
mChart.setDrawValueAboveBar(true);
mChart.getDescription().setEnabled(false);
// if more than 60 entries are displayed in the chart, no values will be
// drawn
mChart.setMaxVisibleValueCount(60);
// scaling can now only be done on x- and y-axis separately
mChart.setPinchZoom(false);
// draw shadows for each bar that show the maximum value
// mChart.setDrawBarShadow(true);
// mChart.setDrawXLabels(false);
mChart.setDrawGridBackground(false);
// mChart.setDrawYLabels(false);
XAxis xAxis = mChart.getXAxis();
xAxis.setEnabled(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(mTfLight);
leftAxis.setLabelCount(6, false);
leftAxis.setAxisMinimum(-2.5f);
leftAxis.setAxisMaximum(2.5f);
leftAxis.setGranularityEnabled(true);
leftAxis.setGranularity(0.1f);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setDrawGridLines(false);
rightAxis.setTypeface(mTfLight);
rightAxis.setLabelCount(6, false);
rightAxis.setAxisMinimum(-2.5f);
rightAxis.setAxisMaximum(2.5f);
rightAxis.setGranularity(0.1f);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarX.setProgress(150); // set data
Legend l = mChart.getLegend();
l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.LEFT);
l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
l.setDrawInside(false);
l.setForm(LegendForm.SQUARE);
l.setFormSize(9f);
l.setTextSize(11f);
l.setXEntrySpace(4f);
mChart.animateXY(2000, 2000);
}
示例14: onCreate
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_realtime_linechart);
mChart = (LineChart) findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
// enable description text
mChart.getDescription().setEnabled(true);
// enable touch gestures
mChart.setTouchEnabled(true);
// enable scaling and dragging
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
mChart.setDrawGridBackground(false);
// if disabled, scaling can be done on x- and y-axis separately
mChart.setPinchZoom(true);
// set an alternative background color
mChart.setBackgroundColor(Color.LTGRAY);
LineData data = new LineData();
data.setValueTextColor(Color.WHITE);
// add empty data
mChart.setData(data);
// get the legend (only possible after setting data)
Legend l = mChart.getLegend();
// modify the legend ...
l.setForm(LegendForm.LINE);
l.setTypeface(mTfLight);
l.setTextColor(Color.WHITE);
XAxis xl = mChart.getXAxis();
xl.setTypeface(mTfLight);
xl.setTextColor(Color.WHITE);
xl.setDrawGridLines(false);
xl.setAvoidFirstLastClipping(true);
xl.setEnabled(true);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(mTfLight);
leftAxis.setTextColor(Color.WHITE);
leftAxis.setAxisMaximum(100f);
leftAxis.setAxisMinimum(0f);
leftAxis.setDrawGridLines(true);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setEnabled(false);
}
示例15: onCreate
import com.github.mikephil.charting.components.Legend; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
mSeekBarY.setOnSeekBarChangeListener(this);
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);
// no description text
mChart.getDescription().setEnabled(false);
// enable touch gestures
mChart.setTouchEnabled(true);
// enable scaling and dragging
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
// if disabled, scaling can be done on x- and y-axis separately
mChart.setPinchZoom(true);
// set an alternative background color
// mChart.setBackgroundColor(Color.GRAY);
// create a custom MarkerView (extend MarkerView) and specify the layout
// to use for it
MyMarkerView mv = new MyMarkerView(this, R.layout.custom_marker_view);
mv.setChartView(mChart); // For bounds control
mChart.setMarker(mv); // Set the marker to the chart
XAxis xl = mChart.getXAxis();
xl.setAvoidFirstLastClipping(true);
xl.setAxisMinimum(0f);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setInverted(true);
leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setEnabled(false);
// add data
setData(25, 50);
// // restrain the maximum scale-out factor
// mChart.setScaleMinima(3f, 3f);
//
// // center the view to a specific position inside the chart
// mChart.centerViewPort(10, 50);
// get the legend (only possible after setting data)
Legend l = mChart.getLegend();
// modify the legend ...
l.setForm(LegendForm.LINE);
// dont forget to refresh the drawing
mChart.invalidate();
}