Java Code Examples for com.github.mikephil.charting.data.BarDataSet#setHighlightEnabled()

The following examples show how to use com.github.mikephil.charting.data.BarDataSet#setHighlightEnabled() . 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 vote down vote up
/**
 * 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 vote down vote up
/**
 * 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 vote down vote up
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: TimeLineView.java    From android-kline with Apache License 2.0 5 votes vote down vote up
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 5
Source File: KLineView.java    From android-kline with Apache License 2.0 5 votes vote down vote up
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;
}