本文整理汇总了Java中com.github.mikephil.charting.charts.CombinedChart类的典型用法代码示例。如果您正苦于以下问题:Java CombinedChart类的具体用法?Java CombinedChart怎么用?Java CombinedChart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CombinedChart类属于com.github.mikephil.charting.charts包,在下文中一共展示了CombinedChart类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Set up chart widgets
* @param layoutInflater - LayoutInflater
* @param container - ViewGroup
* @param savedInstance - Bundle
* @return - View
*/
@Override
@Nullable
public View onCreateView(final LayoutInflater layoutInflater, final ViewGroup container,
final Bundle savedInstance){
super.onCreateView(layoutInflater, container, savedInstance);
final View view = layoutInflater.inflate(R.layout.water_profile, container, false);
mTxtXAxisTitle = (TextView) view.findViewById(R.id.txtXAxisTitle);
mChart = (CombinedChart) view.findViewById(R.id.propertyChart);
mChart.setDrawOrder(new CombinedChart.DrawOrder[]{ CombinedChart.DrawOrder.LINE,
CombinedChart.DrawOrder.SCATTER
});
if (mData != null){
showChart();
}
return view;
}
示例2: prepareLegend
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Create a legend based on a dummy chart. The legend
* is used by all charts and is positioned
* across the top of the screen.
* @param data - CombinedData used to generate the legend
*/
private void prepareLegend(final CombinedData data){
//The dummy chart is never shown, but it's legend is.
final CombinedChart dummyChart = (CombinedChart) mRoot.findViewById(R.id.legend);
dummyChart.getPaint(Chart.PAINT_DESCRIPTION).setTextAlign(Paint.Align.CENTER);
dummyChart.getXAxis().setEnabled(false);
dummyChart.getAxisRight().setEnabled(false);
dummyChart.getAxisLeft().setEnabled(false);
final Description description = new Description();
description.setText("");
description.setTextSize(10f);
dummyChart.setDescription(description);
dummyChart.setBackgroundColor(Color.WHITE);
dummyChart.setDrawGridBackground(false);
dummyChart.setData(data);
final Legend l = dummyChart.getLegend();
l.setEnabled(true);
// The positioning of the legend effectively
// hides the dummy chart from view.
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
dummyChart.invalidate();
}
示例3: onCreateView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_sleepchart, container, false);
mActivityChart = (CombinedChart) rootView.findViewById(R.id.sleepchart);
mSleepAmountChart = (PieChart) rootView.findViewById(R.id.sleepchart_pie_light_deep);
setupActivityChart();
setupSleepAmountChart();
// refresh immediately instead of use refreshIfVisible(), for perceived performance
refresh();
return rootView;
}
示例4: onCreateView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mLocale = getResources().getConfiguration().locale;
View rootView = inflater.inflate(R.layout.fragment_sleepchart, container, false);
GBDevice device = getChartsHost().getDevice();
if (device != null) {
// TODO: eek, this is device specific!
mTargetSteps = MiBandCoordinator.getFitnessGoal(device.getAddress());
}
mWeekStepsChart = (CombinedChart) rootView.findViewById(R.id.sleepchart);
mTodayStepsChart = (PieChart) rootView.findViewById(R.id.sleepchart_pie_light_deep);
setupWeekStepsChart();
setupTodayStepsChart();
// refresh immediately instead of use refreshIfVisible(), for perceived performance
refresh();
return rootView;
}
示例5: createRenderers
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Creates the renderers needed for this combined-renderer in the required order. Also takes the DrawOrder into
* consideration.
*/
public void createRenderers() {
mRenderers.clear();
CombinedChart chart = (CombinedChart)mChart.get();
if (chart == null)
return;
DrawOrder[] orders = chart.getDrawOrder();
for (DrawOrder order : orders) {
switch (order) {
case BAR:
if (chart.getBarData() != null)
mRenderers.add(new BarChartRenderer(chart, mAnimator, mViewPortHandler));
break;
case BUBBLE:
if (chart.getBubbleData() != null)
mRenderers.add(new BubbleChartRenderer(chart, mAnimator, mViewPortHandler));
break;
case LINE:
if (chart.getLineData() != null)
mRenderers.add(new LineChartRenderer(chart, mAnimator, mViewPortHandler));
break;
case CANDLE:
if (chart.getCandleData() != null)
mRenderers.add(new CandleStickChartRenderer(chart, mAnimator, mViewPortHandler));
break;
case SCATTER:
if (chart.getScatterData() != null)
mRenderers.add(new ScatterChartRenderer(chart, mAnimator, mViewPortHandler));
break;
}
}
}
示例6: onCreateView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(com.igrow.android.R.layout.fragment_environmentalsensor_detail,
container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
mCombinedChart = ((CombinedChart) rootView.findViewById(com.igrow.android.R.id.environmentalsensor_detail_chart));
initChart();
}
return rootView;
}
示例7: CombinedChartViewHolder
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
public CombinedChartViewHolder(View itemView) {
super(itemView);
mChart = (CombinedChart) itemView.findViewById(R.id.chart);
mChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
mChart.getAxisRight().setEnabled(false);
mChart.setTouchEnabled(false);
mChart.setDoubleTapToZoomEnabled(false);
mChart.setPinchZoom(false);
mChart.setDescription("");
mChart.setDrawOrder(new CombinedChart.DrawOrder[]{
CombinedChart.DrawOrder.BAR, CombinedChart.DrawOrder.BUBBLE, CombinedChart.DrawOrder.CANDLE, CombinedChart.DrawOrder.LINE, CombinedChart.DrawOrder.SCATTER
});
}
示例8: createRenderers
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Creates the renderers needed for this combined-renderer in the required order. Also takes the DrawOrder into
* consideration.
*
* @param chart
* @param animator
* @param viewPortHandler
*/
protected void createRenderers(CombinedChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler) {
mRenderers = new ArrayList<DataRenderer>();
DrawOrder[] orders = chart.getDrawOrder();
for (DrawOrder order : orders) {
switch (order) {
case BAR:
if (chart.getBarData() != null)
mRenderers.add(new BarChartRenderer(chart, animator, viewPortHandler));
break;
case BUBBLE:
if (chart.getBubbleData() != null)
mRenderers.add(new BubbleChartRenderer(chart, animator, viewPortHandler));
break;
case LINE:
if (chart.getLineData() != null)
mRenderers.add(new LineChartRenderer(chart, animator, viewPortHandler));
break;
case CANDLE:
if (chart.getCandleData() != null)
mRenderers.add(new CandleStickChartRenderer(chart, animator, viewPortHandler));
break;
case SCATTER:
if (chart.getScatterData() != null)
mRenderers.add(new ScatterChartRenderer(chart, animator, viewPortHandler));
break;
}
}
}
示例9: onCreate
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_combined);
mChart = (CombinedChart) findViewById(R.id.chart1);
mChart.setDescription("");
mChart.setBackgroundColor(Color.WHITE);
mChart.setDrawGridBackground(false);
mChart.setDrawBarShadow(false);
// draw bars behind lines
mChart.setDrawOrder(new DrawOrder[] {
DrawOrder.BAR, DrawOrder.BUBBLE, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER
});
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);
CombinedData data = new CombinedData(mMonths);
data.setData(generateLineData());
data.setData(generateBarData());
// data.setData(generateBubbleData());
// data.setData(generateScatterData());
// data.setData(generateCandleData());
mChart.setData(data);
mChart.invalidate();
}
示例10: onCreateView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_market_history, container, false);
ButterKnife.bind(this, view);
chart.setDescription("");
chart.setDrawGridBackground(true);
chart.setGridBackgroundColor(Color.WHITE);
chart.setMaxVisibleValueCount(40);
chart.setDrawOrder(new CombinedChart.DrawOrder[] {
CombinedChart.DrawOrder.BAR, CombinedChart.DrawOrder.CANDLE, CombinedChart.DrawOrder.LINE
});
rightAxis = chart.getAxisRight();
rightAxis.setDrawGridLines(false);
rightAxis.setAxisMinValue(0f);
leftAxis = chart.getAxisLeft();
leftAxis.setDrawGridLines(false);
leftAxis.setAxisMinValue(0f);
leftAxis.setValueFormatter((value, yAxis) ->
value < 1000 ? String.valueOf(value) : NumberUtils.shortened(value, 0));
xAxis = chart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.TOP);
xAxis.setLabelsToSkip(34);
// xAxis.setDrawLabels(false);
return view;
}
示例11: prepareChartView
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Build out the charts for given dataset
* @param id - int representing chart id
* @param data - CombinedData displayed in the chart
*/
private void prepareChartView(final int id, final CombinedData data){
final CombinedChart chart = (CombinedChart) mRoot.findViewById(id);
chart.getPaint(Chart.PAINT_DESCRIPTION).setTextAlign(Paint.Align.CENTER);
chart.getXAxis().setEnabled(false);
chart.getAxisRight().setEnabled(false);
chart.getAxisLeft().setDrawGridLines(false);
chart.getDescription().setEnabled(false);
chart.getLegend().setEnabled(false);
chart.setBackgroundColor(Color.WHITE);
chart.setDrawGridBackground(false);
chart.setData(data);
chart.invalidate();
}
示例12: checkForChartData
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
private void checkForChartData(){
CombinedChart chart = (CombinedChart) solo.getView(R.id.propertyChart) ;
assertTrue(chart.getData().getAllData().size() > 0);
chart = null;
}
示例13: createRenderers
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Creates the renderers needed for this combined-renderer in the required order. Also takes the DrawOrder into
* consideration.
*
* @param chart
* @param animator
* @param viewPortHandler
*/
protected void createRenderers(CombinedChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler) {
mRenderers = new ArrayList<DataRenderer>();
DrawOrder[] orders = chart.getDrawOrder();
for (DrawOrder order : orders) {
switch (order) {
case BAR:
if (chart.getBarData() != null)
mRenderers.add(new BarChartRenderer(chart, animator, viewPortHandler));
break;
case BUBBLE:
if (chart.getBubbleData() != null)
mRenderers.add(new BubbleChartRenderer(chart, animator, viewPortHandler));
break;
case LINE:
if (chart.getLineData() != null)
mRenderers.add(new LineChartRenderer(chart, animator, viewPortHandler));
break;
case CANDLE:
if (chart.getCandleData() != null)
mRenderers.add(new CandleStickChartRenderer(chart, animator, viewPortHandler));
break;
case SCATTER:
if (chart.getScatterData() != null)
mRenderers.add(new ScatterChartRenderer(chart, animator, viewPortHandler));
break;
}
}
}
示例14: CombinedChartRenderer
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
public CombinedChartRenderer(CombinedChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler) {
super(animator, viewPortHandler);
mChart = new WeakReference<Chart>(chart);
createRenderers(chart, animator, viewPortHandler);
}
示例15: createRenderers
import com.github.mikephil.charting.charts.CombinedChart; //导入依赖的package包/类
/**
* Creates the renderers needed for this combined-renderer in the required order. Also takes the DrawOrder into
* consideration.
*
* @param chart
* @param animator
* @param viewPortHandler
*/
protected void createRenderers(CombinedChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler) {
mRenderers.clear();
DrawOrder[] orders = chart.getDrawOrder();
for (DrawOrder order : orders) {
switch (order) {
case BAR:
if (chart.getBarData() != null)
mRenderers.add(new BarChartRenderer(chart, animator, viewPortHandler));
break;
case BUBBLE:
if (chart.getBubbleData() != null)
mRenderers.add(new BubbleChartRenderer(chart, animator, viewPortHandler));
break;
case LINE:
if (chart.getLineData() != null)
mRenderers.add(new LineChartRenderer(chart, animator, viewPortHandler));
break;
case CANDLE:
if (chart.getCandleData() != null)
mRenderers.add(new CandleStickChartRenderer(chart, animator, viewPortHandler));
break;
case SCATTER:
if (chart.getScatterData() != null)
mRenderers.add(new ScatterChartRenderer(chart, animator, viewPortHandler));
break;
}
}
}