本文整理汇总了Java中com.github.mikephil.charting.data.BarDataSet.setHighLightAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java BarDataSet.setHighLightAlpha方法的具体用法?Java BarDataSet.setHighLightAlpha怎么用?Java BarDataSet.setHighLightAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.BarDataSet
的用法示例。
在下文中一共展示了BarDataSet.setHighLightAlpha方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateDataBar
import com.github.mikephil.charting.data.BarDataSet; //导入方法依赖的package包/类
/**
* generates a random ChartData object with just one DataSet
*
* @return
*/
private BarData generateDataBar(int cnt) {
ArrayList<BarEntry> entries = new ArrayList<BarEntry>();
for (int i = 0; i < 12; i++) {
entries.add(new BarEntry(i, (int) (Math.random() * 70) + 30));
}
BarDataSet d = new BarDataSet(entries, "New DataSet " + cnt);
d.setColors(ColorTemplate.VORDIPLOM_COLORS);
d.setHighLightAlpha(255);
BarData cd = new BarData(d);
cd.setBarWidth(0.9f);
return cd;
}
示例2: generateDataBar
import com.github.mikephil.charting.data.BarDataSet; //导入方法依赖的package包/类
/**
* generates a random ChartData object with just one DataSet
*
* @return
*/
private BarData generateDataBar(int cnt) {
ArrayList<BarEntry> entries = new ArrayList<BarEntry>();
for (int i = 0; i < 12; i++) {
entries.add(new BarEntry((int) (Math.random() * 70) + 30, i));
}
BarDataSet d = new BarDataSet(entries, "New DataSet " + cnt);
d.setBarSpacePercent(20f);
d.setColors(ColorTemplate.VORDIPLOM_COLORS);
d.setHighLightAlpha(255);
BarData cd = new BarData(getMonths(), d);
return cd;
}
示例3: generateDataBar
import com.github.mikephil.charting.data.BarDataSet; //导入方法依赖的package包/类
/**
* 生成柱状图的数据
*/
private BarData generateDataBar() {
ArrayList<BarEntry> entries = new ArrayList<BarEntry>();
for (int i = 0; i < 12; i++) {
entries.add(new BarEntry((int) (Math.random() * 70) + 30, i));
}
BarDataSet d = new BarDataSet(entries, "New DataSet ");
// 设置柱状图之间的间距
d.setBarSpacePercent(20f);
// 设置显示的柱状图的颜色
d.setColors(ColorTemplate.VORDIPLOM_COLORS);
// 设置高亮的透明度:当点击柱状图时显示的透明度
d.setHighLightAlpha(255);
BarData cd = new BarData(getMonths(), d);
return cd;
}
示例4: dataSetConfig
import com.github.mikephil.charting.data.BarDataSet; //导入方法依赖的package包/类
@Override
void dataSetConfig(IDataSet<BarEntry> dataSet, ReadableMap config) {
BarDataSet barDataSet = (BarDataSet) dataSet;
ChartDataSetConfigUtils.commonConfig(barDataSet, config);
ChartDataSetConfigUtils.commonBarLineScatterCandleBubbleConfig(barDataSet, config);
if (BridgeUtils.validate(config, ReadableType.Number, "barSpacePercent")) {
barDataSet.setBarSpacePercent((float) config.getDouble("barSpacePercent"));
}
if (BridgeUtils.validate(config, ReadableType.String, "barShadowColor")) {
barDataSet.setBarShadowColor(Color.parseColor(config.getString("barShadowColor")));
}
if (BridgeUtils.validate(config, ReadableType.Number, "highlightAlpha")) {
barDataSet.setHighLightAlpha(config.getInt("highlightAlpha"));
}
if (BridgeUtils.validate(config, ReadableType.Array, "stackLabels")) {
barDataSet.setStackLabels(BridgeUtils.convertToStringArray(config.getArray("stackLabels")));
}
}
示例5: populateBarData
import com.github.mikephil.charting.data.BarDataSet; //导入方法依赖的package包/类
/**
* Set the bar chart data source
*/
public static BarData populateBarData(List<BarEntry> entries, String label, List<Integer> colors){
BarDataSet barDataSet = new BarDataSet(entries, label);
if (colors != null) {
barDataSet.setColors(colors);
}
barDataSet.setHighLightAlpha(255);
return new BarData(barDataSet);
}