@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.frag_simple_bar, container, false); // create a new chart object chart = new BarChart(getActivity()); chart.getDescription().setEnabled(false); chart.setOnChartGestureListener(this); MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view); mv.setChartView(chart); // For bounds control chart.setMarker(mv); chart.setDrawGridBackground(false); chart.setDrawBarShadow(false); Typeface tf = Typeface.createFromAsset(context.getAssets(), "OpenSans-Light.ttf"); chart.setData(generateBarData(1, 20000, 12)); Legend l = chart.getLegend(); l.setTypeface(tf); YAxis leftAxis = chart.getAxisLeft(); leftAxis.setTypeface(tf); leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true) chart.getAxisRight().setEnabled(false); XAxis xAxis = chart.getXAxis(); xAxis.setEnabled(false); // programmatically add the chart FrameLayout parent = v.findViewById(R.id.parentLayout); parent.addView(chart); return v; }
xAxis.setDrawGridLines(false); YAxis leftAxis = holder.chart.getAxisLeft(); leftAxis.setTypeface(tfLight); leftAxis.setLabelCount(5, false);
xAxis.setDrawAxisLine(true); YAxis leftAxis = holder.chart.getAxisLeft(); leftAxis.setTypeface(mTf); leftAxis.setLabelCount(5, false);
xAxis.setDrawGridLines(false); chart.getAxisLeft().setDrawGridLines(false);
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_scrollview); setTitle("ScrollViewActivity"); chart = findViewById(R.id.chart1); chart.getDescription().setEnabled(false); // scaling can now only be done on x- and y-axis separately chart.setPinchZoom(false); chart.setDrawBarShadow(false); chart.setDrawGridBackground(false); XAxis xAxis = chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setDrawGridLines(false); chart.getAxisLeft().setDrawGridLines(false); chart.getLegend().setEnabled(false); setData(10); chart.setFitBars(true); }
YAxis leftAxis = chart.getAxisLeft(); leftAxis.setValueFormatter(new MyValueFormatter("K")); leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
YAxis leftAxis = chart.getAxisLeft(); leftAxis.setTypeface(tfLight); leftAxis.setValueFormatter(new LargeValueFormatter());
xAxis.setGranularity(1f); YAxis left = chart.getAxisLeft(); left.setDrawLabels(false); left.setSpaceTop(25f);
YAxis leftAxis = chart.getAxisLeft(); leftAxis.setTypeface(tfLight); leftAxis.setLabelCount(8, false);
xAxis.setEnabled(false); YAxis leftAxis = chart.getAxisLeft(); leftAxis.setTypeface(tfLight); leftAxis.setLabelCount(6, false);
private void initChartBar(BarChart chart) { chart.setTouchEnabled(true); chart.setDrawGridBackground(true); chart.getAxisRight().setEnabled(false); chart.setDrawGridBackground(true); YAxis leftAxis = chart.getAxisLeft(); leftAxis.setAxisMaxValue(100F); leftAxis.setAxisMinValue(10F); leftAxis.setStartAtZero(false); leftAxis.setAxisLineWidth(2); leftAxis.setDrawGridLines(true); // X-Axis XAxis xAxis = chart.getXAxis(); xAxis.resetLabelsToSkip(); xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); xAxis.setDrawGridLines(true); }
public BarChartManager(BarChart barChart) { this.barChart = barChart; leftAxis = this.barChart.getAxisLeft(); rightAxis = this.barChart.getAxisRight(); xAxis = this.barChart.getXAxis(); }
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); 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); mChart.setDrawBarShadow(false); mChart.setDrawGridBackground(false); XAxis xAxis = mChart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setDrawGridLines(false); mChart.getAxisLeft().setDrawGridLines(false); // setting data mSeekBarX.setProgress(10); mSeekBarY.setProgress(100); // add a nice and smooth animation mChart.animateY(2500); mChart.getLegend().setEnabled(false); }
xAxis.setDrawGridLines(false); YAxis leftAxis = holder.chart.getAxisLeft(); leftAxis.setTypeface(mTfLight); leftAxis.setLabelCount(5, false);
xAxis.setDrawAxisLine(true); YAxis leftAxis = holder.chart.getAxisLeft(); leftAxis.setTypeface(mTf); leftAxis.setLabelCount(5, false);
l.setTypeface(tf); YAxis leftAxis = mChart.getAxisLeft(); leftAxis.setTypeface(tf); leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mChart.getDescription().setEnabled(false); // scaling can now only be done on x- and y-axis separately mChart.setPinchZoom(false); mChart.setDrawBarShadow(false); mChart.setDrawGridBackground(false); XAxis xAxis = mChart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setDrawGridLines(false); mChart.getAxisLeft().setDrawGridLines(false); mChart.getLegend().setEnabled(false); setData(10); mChart.setFitBars(true); }
YAxis leftAxis = mChart.getAxisLeft(); leftAxis.setValueFormatter(new MyAxisValueFormatter()); leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO ZHUANGHONGJI when i repeat to enter this Activity , a crash happened setup(lineChart); setup(barChart); lineChart.setExtraBottomOffset(5f); barChart.setExtraBottomOffset(5f); lineChart.getAxisLeft().setDrawGridLines(false); lineChart.getXAxis().setDrawGridLines(false); lineChart.getXAxis().setLabelCount(5); lineChart.getXAxis().setGranularity(1f); barChart.getAxisLeft().setDrawGridLines(false); barChart.getXAxis().setDrawGridLines(false); barChart.getXAxis().setLabelCount(5); barChart.getXAxis().setGranularity(1f); }
YAxis yAxisLeft = barChart.getAxisLeft(); yAxisLeft.setAxisMinimum(0);