Java Code Examples for com.github.mikephil.charting.data.BarDataSet#setHighLightColor()
The following examples show how to use
com.github.mikephil.charting.data.BarDataSet#setHighLightColor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CurrentDayFragment.java From shinny-futures-android with GNU General Public License v3.0 | 5 votes |
/** * date: 2019/2/21 * author: chenli * description: 生成成交量数据集 */ private BarDataSet generateBarDataSet(List<BarEntry> entries, String label, boolean isHighlight, int... colors) { BarDataSet set = new BarDataSet(entries, label); set.setColors(colors); set.setBarBorderWidth(0); set.setDrawValues(false); set.setAxisDependency(YAxis.AxisDependency.LEFT); if (isHighlight) { set.setHighLightColor(mHighlightColor); } else { set.setHighlightEnabled(false); } return set; }
Example 2
Source File: KlineFragment.java From shinny-futures-android with GNU General Public License v3.0 | 5 votes |
/** * date: 2019/2/22 * author: chenli * description: 生成成交量数据集 */ private BarDataSet generateBarDataSet(List<BarEntry> entries, String label, boolean isHighlight, int... colors) { BarDataSet set = new BarDataSet(entries, label); set.setColors(colors); set.setBarBorderWidth(0); set.setDrawValues(false); set.setAxisDependency(YAxis.AxisDependency.LEFT); if (isHighlight) { set.setHighLightColor(mHighlightColor); } else { set.setHighlightEnabled(false); } return set; }
Example 3
Source File: KLineDataManage.java From StockChart-MPAndroidChart with MIT License | 5 votes |
private BarDataSet setABar(ArrayList<BarEntry> barEntries, String label) { BarDataSet barDataSet = new BarDataSet(barEntries, label); barDataSet.setHighlightEnabled(true);//是否画高亮十字线 barDataSet.setHighLightColor(ContextCompat.getColor(mContext, R.color.highLight_Color));//高亮十字线颜色 barDataSet.setValueTextSize(10); barDataSet.setDrawValues(false);//是否画出每个蜡烛线的数值 barDataSet.setNeutralColor(ContextCompat.getColor(mContext, R.color.equal_color));//行情平势时蜡烛的标识颜色 barDataSet.setIncreasingColor(ContextCompat.getColor(mContext, R.color.up_color));//行情涨势时蜡烛的标识颜色 barDataSet.setDecreasingColor(ContextCompat.getColor(mContext, R.color.down_color));//行情跌势时蜡烛的标识颜色 barDataSet.setIncreasingPaintStyle(Paint.Style.FILL);//蜡烛实心或空心 barDataSet.setDecreasingPaintStyle(Paint.Style.FILL); return barDataSet; }
Example 4
Source File: BarChartHelper.java From Ticket-Analysis with MIT License | 5 votes |
public IBarDataSet generateBarDataSet(List<BarEntry> entries, String[] describle, List<Integer> colors) { BarDataSet dataSet = new BarDataSet(entries, describle.length > 1 ? "" : describle[0]); dataSet.setColors(colors); dataSet.setStackLabels(describle); // dataSet.setValueTextSize(11f); int highLightColor = 0x20ffffff; dataSet.setHighLightColor(highLightColor); return dataSet; }
Example 5
Source File: TimeLineView.java From android-kline with Apache License 2.0 | 5 votes |
private BarDataSet setBar(ArrayList<BarEntry> barEntries, int type) { BarDataSet barDataSet = new BarDataSet(barEntries, "vol"); barDataSet.setHighLightAlpha(120); barDataSet.setHighLightColor(getResources().getColor(R.color.highlight_color)); barDataSet.setDrawValues(false); barDataSet.setVisible(type != INVISIABLE_LINE); barDataSet.setHighlightEnabled(type != INVISIABLE_LINE); barDataSet.setColors(getResources().getColor(R.color.increasing_color), getResources().getColor(R.color.decreasing_color)); return barDataSet; }
Example 6
Source File: KLineView.java From android-kline with Apache License 2.0 | 5 votes |
private BarDataSet setBar(ArrayList<BarEntry> barEntries, int type) { BarDataSet barDataSet = new BarDataSet(barEntries, "vol"); barDataSet.setHighLightAlpha(120); barDataSet.setHighLightColor(getResources().getColor(R.color.highlight_color)); barDataSet.setDrawValues(false); barDataSet.setVisible(type != INVISIABLE_LINE); barDataSet.setHighlightEnabled(type != INVISIABLE_LINE); barDataSet.setColors(getResources().getColor(R.color.increasing_color), getResources().getColor(R.color.decreasing_color)); return barDataSet; }