本文整理匯總了Java中com.googlecode.gwt.charts.client.options.LegendAlignment類的典型用法代碼示例。如果您正苦於以下問題:Java LegendAlignment類的具體用法?Java LegendAlignment怎麽用?Java LegendAlignment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LegendAlignment類屬於com.googlecode.gwt.charts.client.options包,在下文中一共展示了LegendAlignment類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getOptions
import com.googlecode.gwt.charts.client.options.LegendAlignment; //導入依賴的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;
}
示例2: getOptions
import com.googlecode.gwt.charts.client.options.LegendAlignment; //導入依賴的package包/類
private AreaChartOptions 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.setTextPosition(TextPosition.NONE);
vAxis.setGridlines(lines);
hAxis.setGridlines(lines);
// Legend
Legend legend = Legend.create();
legend.setPosition(LegendPosition.TOP);
legend.setAligment(LegendAlignment.END);
// Set options
AreaChartOptions options = AreaChartOptions.create();
options.setIsStacked(true);
options.setAreaOpacity(1);
options.setVAxis(vAxis);
options.setHAxis(hAxis);
options.setLegend(legend);
options.setColors("2196f3", "42a5f5", "64b5f6", "90caf9", "bbdefb");
ChartArea area = ChartArea.create();
area.setTop(0);
area.setLeft(0);
area.setWidth("100%");
area.setHeight("100%");
options.setChartArea(area);
//Set Animation
Animation animation = Animation.create();
animation.setDuration(500);
animation.setEasing(AnimationEasing.OUT);
options.setAnimation(animation);
return options;
}
示例3: createChartLegend
import com.googlecode.gwt.charts.client.options.LegendAlignment; //導入依賴的package包/類
protected Legend createChartLegend() {
GoogleLegendWrapper legend = GoogleLegendWrapper.create();
legend.setLegendPosition(getLegendPosition());
legend.setAligment(LegendAlignment.CENTER);
return legend;
}