本文整理匯總了Java中com.googlecode.gwt.charts.client.corechart.BarChartOptions類的典型用法代碼示例。如果您正苦於以下問題:Java BarChartOptions類的具體用法?Java BarChartOptions怎麽用?Java BarChartOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BarChartOptions類屬於com.googlecode.gwt.charts.client.corechart包,在下文中一共展示了BarChartOptions類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBarOptions
import com.googlecode.gwt.charts.client.corechart.BarChartOptions; //導入依賴的package包/類
protected CoreOptions createBarOptions() {
BarChartOptions options = BarChartOptions.create();
options.setWidth(width);
options.setHeight(height);
options.setBackgroundColor(bgColor);
options.setLegend(createChartLegend());
options.setIsStacked(isStacked);
options.setHAxis(createHAxis());
options.setVAxis(createVAxis());
if (animationOn) {
Animation anim = Animation.create();
anim.setDuration(animationDuration);
anim.setEasing(AnimationEasing.IN_AND_OUT);
options.setAnimation(anim);
}
// TODO: options.set3D(displayerSettings.is3d());
options.setChartArea(createChartArea());
options.setColors(colors);
return options;
}
示例2: getOptions
import com.googlecode.gwt.charts.client.corechart.BarChartOptions; //導入依賴的package包/類
private BarChartOptions getOptions() {
// Grid Lines
Gridlines lines = Gridlines.create();
lines.setColor("fff");
// Text Positions X and Y Axis
HAxis hAxis = HAxis.create();
hAxis.setTextPosition(TextPosition.NONE);
VAxis vAxis = VAxis.create();
vAxis.setGridlines(lines);
hAxis.setGridlines(lines);
// Legend
Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
legend.setAligment(LegendAlignment.START);
// Set options
BarChartOptions options = BarChartOptions.create();
options.setHAxis(HAxis.create("Cups"));
options.setVAxis(VAxis.create("Year"));
options.setColors("#2196f3", "#42a5f5", "#64b5f6", "#90caf9");
options.setVAxis(vAxis);
options.setHAxis(hAxis);
options.setLegend(legend);
// Set Animation
Animation animation = Animation.create();
animation.setDuration(500);
animation.setEasing(AnimationEasing.OUT);
options.setAnimation(animation);
// Set Bar
Bar bar = Bar.create();
bar.setGroupWidth("50%");
return options;
}