@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; }
holder.chart.setDrawGridBackground(false); XAxis xAxis = holder.chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setTypeface(tfLight);
holder.chart.setDrawBarShadow(false); XAxis xAxis = holder.chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setTypeface(mTf);
chart.setDrawGridBackground(false); XAxis xAxis = chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.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); }
chart.getAxisRight().setEnabled(false); XAxis xLabels = chart.getXAxis(); xLabels.setPosition(XAxisPosition.TOP);
l.setTextSize(8f); XAxis xAxis = chart.getXAxis(); xAxis.setTypeface(tfLight); xAxis.setGranularity(1f);
XAxis xAxis = chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setTypeface(tfRegular);
XAxis xAxis = chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setTypeface(tfLight);
XAxis xAxis = chart.getXAxis(); xAxis.setEnabled(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(); }
private void recalculateXAxis() { final XAxis xAxis = barChart.getXAxis(); xAxis.setAxisMinimum(0); xAxis.setAxisMaximum(histogramData.getNumBins()); barChart.notifyDataSetChanged(); barChart.invalidate(); }
@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); }