本文整理汇总了Java中com.googlecode.gwt.charts.client.corechart.PieChartOptions.create方法的典型用法代码示例。如果您正苦于以下问题:Java PieChartOptions.create方法的具体用法?Java PieChartOptions.create怎么用?Java PieChartOptions.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.gwt.charts.client.corechart.PieChartOptions
的用法示例。
在下文中一共展示了PieChartOptions.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawPieChart
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
/**
* Updates the pue chart with new data
* @param sentimentSummary
*/
private static void drawPieChart(JsArray<SentimentSummary> sentimentSummary) {
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Sentiment");
data.addColumn(ColumnType.NUMBER, "Count");
data.addRows(sentimentSummary.length());
int j = sentimentSummary.length();
for (int i = 0; i < j; i++) {
data.setValue(i, 0, sentimentSummary.get(i).getId());
data.setValue(i, 1, sentimentSummary.get(i).getValue());
}
Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
PieChartOptions options = PieChartOptions.create();
options.setWidth(500);
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setTop(50);
area.setLeft(25);
options.setChartArea(area);
options.setLegend(legend);
options.setColors("BDBDBD", "26A69A", "FF6E40");
pieChart.draw(data, options);
}
示例2: drawPieChart
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
/**
* Updates the pue chart with new data
* @param sourcesSummary
*/
private static void drawPieChart(JsArray<SourceSummary> sourcesSummary) {
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Client");
data.addColumn(ColumnType.NUMBER, "Count");
data.addRows(sourcesSummary.length());
int j = sourcesSummary.length();
for (int i = 0; i < j; i++) {
data.setValue(i, 0, sourcesSummary.get(i).getId());
data.setValue(i, 1, sourcesSummary.get(i).getValue());
}
Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
PieChartOptions options = PieChartOptions.create();
options.setWidth(500);
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setTop(50);
area.setLeft(25);
options.setChartArea(area);
options.setLegend(legend);
options.setColors("00796b", "00897b", "009688", "26a69a", "4db6ac", "80cbc4", "b2dfdb");
pieChart.draw(data, options);
}
示例3: draw
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
private void draw() {
// Prepare the data
DataTable dataTable = DataTable.create();
dataTable.addColumn(ColumnType.STRING, "Task");
dataTable.addColumn(ColumnType.NUMBER, "Hours per Day");
dataTable.addRows(2);
dataTable.setValue(0, 0, "Work");
dataTable.setValue(0, 1, 11);
dataTable.setValue(1, 0, "Sleep");
dataTable.setValue(1, 1, 7);
// Set options
PieChartOptions options = PieChartOptions.create();
options.setBackgroundColor("#f0f0f0");
// options.setColors(colors);
options.setFontName("Tahoma");
options.setIs3D(true);
options.setPieResidueSliceColor("#000000");
options.setPieResidueSliceLabel("Others");
options.setSliceVisibilityThreshold(0.1);
options.setTitle("So, how was your day?");
options.setHeight(100);
options.setWidth(100);
// Draw the chart
chart.draw(dataTable, options);
}
示例4: PieOpt
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
private PieOpt() {
_this = PieChartOptions.create();
}
示例5: PieChartOptionsWrapper
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
private PieChartOptionsWrapper() {
_this = PieChartOptions.create();
}
示例6: draw
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
/**
* Creates the pie chart visualization, using the Google Charts framework.
*/
protected void draw() {
// Determine movie count of every genre
HashMap<String, Integer> genreMap = new HashMap<String, Integer>();
for (Movie m : movieCollection.getMovies()) {
for (String s : m.getGenre()) {
if (genreMap.containsKey(s)) {
int tmpCount = genreMap.get(s);
tmpCount++;
genreMap.put(s, tmpCount);
} else {
genreMap.put(s, 1);
}
}
}
// Create DataTable
DataTable dataTable = DataTable.create();
dataTable.addColumn(ColumnType.STRING, "Genre");
dataTable.addColumn(ColumnType.NUMBER, "Genre Percentage");
dataTable.addRows(genreMap.size());
// Fill DataTable
Set<String> genreNames = genreMap.keySet();
int i = 0;
Iterator<String> iter = genreNames.iterator();
while(iter.hasNext()) {
String genre = iter.next();
dataTable.setValue(i, 0, genre);
// The percentage of the genre is automatically calculated by the framework
dataTable.setValue(i, 1, genreMap.get(genre));
i++;
}
// PieChart options
PieChartOptions options = PieChartOptions.create();
options.setTitle("Genre Distribution by Percent");
// Languages with less than 2.5 percent are collected under the category "Other"
options.setPieResidueSliceColor("#505050");
options.setPieResidueSliceLabel("Other");
options.setSliceVisibilityThreshold(0.025);
// Display options
options.setFontName("Arial");
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setLeft(0);
area.setTop(55);
area.setHeight(300);
options.setChartArea(area);
// Draw the chart
pieChart.draw(dataTable, options);
}
示例7: draw
import com.googlecode.gwt.charts.client.corechart.PieChartOptions; //导入方法依赖的package包/类
/**
* Creates the pie chart visualization, using the Google Charts framework.
*/
protected void draw() {
// Determine movie count of every language
HashMap<String, Integer> languageMap = new HashMap<String, Integer>();
for (Movie m : movieCollection.getMovies()) {
for (String s : m.getLanguage()) {
if (languageMap.containsKey(s)) {
int tmpCount = languageMap.get(s);
tmpCount++;
languageMap.put(s, tmpCount);
} else {
languageMap.put(s, 1);
}
}
}
// Create DataTable
DataTable dataTable = DataTable.create();
dataTable.addColumn(ColumnType.STRING, "Language");
dataTable.addColumn(ColumnType.NUMBER, "Language Percentage");
dataTable.addRows(languageMap.size());
// Fill DataTable
Set<String> languageNames = languageMap.keySet();
int i = 0;
Iterator<String> iter = languageNames.iterator();
while(iter.hasNext()) {
String language = iter.next();
dataTable.setValue(i, 0, language);
// The percentage of the genre is automatically calculated by the framework
dataTable.setValue(i, 1, languageMap.get(language));
i++;
}
// PieChart options
PieChartOptions options = PieChartOptions.create();
options.setTitle("Language Distribution by Percent");
// Languages with less than 2.5 percent are collected under the category "Other"
options.setPieResidueSliceColor("#505050");
options.setPieResidueSliceLabel("Other");
options.setSliceVisibilityThreshold(0.025);
// Display options
options.setFontName("Arial");
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setLeft(0);
area.setTop(55);
area.setHeight(300);
options.setChartArea(area);
// Draw the chart
pieChart.draw(dataTable, options);
}