@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; }
data.setValueTextColor(Color.BLACK); holder.chart.getDescription().setEnabled(false); holder.chart.setDrawGridBackground(false);
holder.chart.getDescription().setEnabled(false); holder.chart.setDrawGridBackground(false); holder.chart.setDrawBarShadow(false);
chart.getDescription().setEnabled(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.getDescription().setEnabled(false);
chart.setOnChartValueSelectedListener(this); chart.getDescription().setEnabled(false);
chart.setDrawValueAboveBar(true); chart.getDescription().setEnabled(false);
chart.setDrawValueAboveBar(true); chart.getDescription().setEnabled(false);
chart.setDrawValueAboveBar(true); chart.getDescription().setEnabled(false);
public void setDescription(String description) { getBarChart().getDescription().setText(description); }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.button_start_midi_in: disableButtons(); latencyChart.setVisibility(View.VISIBLE); latencyChart.clearData(); latencyChart.setLegendEnabled(false); latencyChart.getBarChart().getDescription().setText("MIDI Input Latency [ms]"); midiTest.testMidiIn(); break; case R.id.button_start_midi_out: disableButtons(); latencyChart.setVisibility(View.VISIBLE); latencyChart.clearData(); latencyChart.setLegendEnabled(false); latencyChart.getBarChart().getDescription().setText("MIDI Output Latency [ms]"); midiTest.testMidiOut(); break; } }
@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); }
holder.chart.getDescription().setEnabled(false); holder.chart.setDrawGridBackground(false);
holder.chart.getDescription().setEnabled(false); holder.chart.setDrawGridBackground(false); holder.chart.setDrawBarShadow(false);
mChart.getDescription().setEnabled(false); mChart.setOnChartGestureListener(this);
@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); }
mChart.getDescription().setEnabled(false);
super.onCreate(savedInstanceState); mChart.getDescription().setEnabled(false);
barChart.getDescription().setEnabled(false); barChart.setNoDataText("无数据");