• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DataTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gwt.visualization.client.DataTable的典型用法代码示例。如果您正苦于以下问题:Java DataTable类的具体用法?Java DataTable怎么用?Java DataTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataTable类属于com.google.gwt.visualization.client包,在下文中一共展示了DataTable类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private void setChart(List<PacketWrongAnswer> wrongAnswers) {
	DataTable data = DataTable.create();
	data.addColumn(ColumnType.STRING, "誤解答");
	data.addColumn(ColumnType.NUMBER, "回答数");
	data.addRows(wrongAnswers.size());
	for (int row = 0; row < wrongAnswers.size(); ++row) {
		PacketWrongAnswer wrongAnswer = wrongAnswers.get(row);
		data.setValue(row, 0, wrongAnswer.answer);
		data.setValue(row, 1, wrongAnswer.count);
	}

	Options options = Options.create();
	options.setWidth(780);
	options.setHeight(400);
	options.setTitle("誤解答例");

	panel.setWidget(new PieChart(data, options));
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:19,代码来源:WrongAnswerViewImpl.java


示例2: table

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private static AbstractDataTable table(int[] distribution, int min, int max) {
	DataTable data = DataTable.create();
	data.addRows(distribution.length);

	int saturateThreshold;
	if (distribution.length == 1) {
		saturateThreshold = distribution[0];
	} else {
		List<Integer> sorted = Lists.newArrayList();
		for (int rating : distribution) {
			sorted.add(rating);
		}
		Collections.sort(sorted);
		saturateThreshold = (int) (sorted.get(sorted.size() - 2) * 1.5);
	}

	data.addColumn(ColumnType.NUMBER, "レーティング");
	data.addColumn(ColumnType.NUMBER, "人数");
	for (int row = 0; row < distribution.length; ++row) {
		data.setValue(row, 0, (double) row / distribution.length * (max - min) + min);
		data.setValue(row, 1, Math.min(saturateThreshold, distribution[row]));
	}

	return data;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:26,代码来源:PanelStatisticsRatingDistribution.java


示例3: createPieChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
/**
 * Create pie chart
 *
 * @return
 */
private PieChart createPieChart() {
  DataTable data = createDataTable();
  PieOptions options = PieChart.createPieOptions();
  options.setWidth(chartPanel.getOffsetWidth());
  options.setHeight(chartPanel.getOffsetHeight());
  options.set3D(true);
  return new PieChart(data, options);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:14,代码来源:VisualizationPopup.java


示例4: createBarChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
/**
 * Create bar chart
 *
 * @return
 */
private BarChart createBarChart() {
  DataTable data = createDataTable();
  Options options = Options.create();
  options.setWidth(chartPanel.getOffsetWidth());
  options.setHeight(chartPanel.getOffsetHeight());
  return new BarChart(data, options);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:13,代码来源:VisualizationPopup.java


示例5: createDurationChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private ColumnChart createDurationChart() {
    durationChartOptions = createChartOptions();
    durationChartOptions.setTitle("Total Duration in ms");

    durationData = DataTable.create();
    durationData.addColumn(AbstractDataTable.ColumnType.STRING, "Label");
    durationData.addColumn(AbstractDataTable.ColumnType.NUMBER, "Duration");
    durationData.addColumn(AbstractDataTable.ColumnType.NUMBER, "Duration");

    durationChart = new ColumnChart(durationData, durationChartOptions);
    durationChart.setTitle("Duration");
    return durationChart;
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:14,代码来源:UsageView.java


示例6: createCounterChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private ColumnChart createCounterChart() {
    counterChartOptions = createChartOptions();
    counterChartOptions.setTitle("Execution count");

    counterData = DataTable.create();
    counterData.addColumn(AbstractDataTable.ColumnType.STRING, "Label");
    counterData.addColumn(AbstractDataTable.ColumnType.NUMBER, "Counter");
    counterData.addColumn(AbstractDataTable.ColumnType.NUMBER, "Counter");

    counterChart = new ColumnChart(counterData, counterChartOptions);
    counterChart.setTitle("Count");
    return counterChart;
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:14,代码来源:UsageView.java


示例7: MBeanChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
public MBeanChart(RMController controller, String jmxServerUrl, String mbean, String[] attrs, String title) {
    this.controller = controller;
    this.jmxServerUrl = jmxServerUrl;
    this.mbeanName = mbean;
    this.attrs = attrs;

    loadOpts = Options.create();
    HorizontalAxisOptions loadAxis = HorizontalAxisOptions.create();
    loadAxis.setMaxAlternation(1);
    loadAxis.setSlantedText(false);
    loadOpts.setLegend(LegendPosition.NONE);
    loadOpts.setHAxisOptions(loadAxis);
    loadOpts.setColors("#fcaf3e", "#3a668d", "#35a849", "#fcaf3e", "#24c1ff", "#1e4ed7", "#ef2929", "#000000");
    loadAxis.setMinValue(0);

    loadTable = DataTable.create();

    setWidth100();
    setHeight100();

    if (title.length() > 0) {
        Label label = new Label("<nobr style='font-weight:bold;padding-left:10px;'>" + title + "<nobr>");
        label.setHeight(30);
        addMember(label);
    }

    chartContainer = new AbsolutePanel();
    chartContainer.setWidth("100%");
    chartContainer.setHeight("200px");

    loadChart = createChart(loadTable, loadOpts);
    loadChart.setWidth("100%");
    loadChart.setHeight("200px");
    chartContainer.add(loadChart);
    if (!(loadChart instanceof PieChart)) {
        addMember(getTimeSlotSelector());
    }
    addMember(chartContainer);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:40,代码来源:MBeanChart.java


示例8: table

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private static AbstractDataTable table(List<Integer> rating) {
	DataTable data = DataTable.create();
	data.addRows(rating.size());

	// 正解率
	data.addColumn(ColumnType.NUMBER, "回数");
	data.addColumn(ColumnType.NUMBER, "レーティング");
	for (int row = 0; row < rating.size(); ++row) {
		data.setValue(row, 0, row);
		data.setValue(row, 1, rating.get(row));
	}

	return data;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:15,代码来源:PanelStatisticsRatingHistory.java


示例9: table

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private static AbstractDataTable table(int ranking[][]) {
	DataTable data = DataTable.create();
	data.addRows(NUMBER_OF_ITEMS);

	// 正解率
	data.addColumn(ColumnType.STRING, "正解率");
	data.addColumn(ColumnType.NUMBER, "平均レーティング");
	for (int row = 0; row < NUMBER_OF_ITEMS; ++row) {
		data.setValue(row, 0, Constant.PREFECTURE_NAMES[ranking[row][0]]);
		data.setValue(row, 1, ranking[row][1]);
	}

	return data;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:15,代码来源:ChartPrefectureRatingRanking.java


示例10: table

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private static AbstractDataTable table(int rate[][]) {
	Preconditions
			.checkArgument(rate.length == ProblemGenre.values().length);

	DataTable data = DataTable.create();
	data.addRows(11);

	// 正解率
	data.addColumn(ColumnType.STRING, "正解率");
	for (int row = 0; row <= 10; ++row) {
		data.setValue(row, 0, (row * 10) + "%");
	}

	// ジャンルごとの正解率
	int column = 1;
	for (ProblemGenre genre : ProblemGenre.values()) {
		Preconditions.checkArgument(rate[genre.getIndex()].length == 11);

		data.addColumn(ColumnType.NUMBER, genre.toString());

		int sum = 0;
		for (int num : rate[genre.getIndex()]) {
			sum += num;
		}

		for (int row = 0; row <= 10; ++row) {
			data.setValue(row, column, 100.0 * rate[genre.getIndex()][row]
					/ sum);
		}

		++column;
	}

	return data;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:36,代码来源:ChartAccuracyRate.java


示例11: renderChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private void renderChart(final ESResponse.Facets<ESResponse.TermFacet> facets,
                         final String title, final String tag) {
  if (facets == null) {
    return;
  }
  final DataTable data = DataTable.create();
  data.addColumn(DataTable.ColumnType.STRING, "Backend");
  data.addColumn(DataTable.ColumnType.NUMBER, "Number of times slowest");
  final JsArray<ESResponse.TermFacet> terms = facets.terms();
  final int nterms = terms.length();
  data.addRows(nterms);
  for (int i = 0; i < nterms; i++) {
    final ESResponse.TermFacet facet = terms.get(i);
    final String backend = facet.term();
    if ("unknown".equals(backend)) {
      continue;
    }
    data.setValue(i, 0, backend);
    data.setValue(i, 1, facet.count());
  }
  final PieChart.PieOptions options = PieChart.createPieOptions();
  options.setWidth(400);
  options.setHeight(240);
  options.setTitle(title);
  final PieChart chart = new PieChart(data, options);
  final SearchOnSelectHandler handler = new SearchOnSelectHandler(chart, data, tag);
  chart.addSelectHandler(handler);
  charts.add(chart);
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:30,代码来源:Main.java


示例12: SearchOnSelectHandler

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
private SearchOnSelectHandler(final CoreChart chart,
                              final DataTable data,
                              final String tag) {
  this.chart = chart;
  this.data = data;
  this.tag = tag + ":";
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:8,代码来源:Main.java


示例13: createChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
@Override
public CoreChart createChart(DataTable data, Options opts) {
    return new LineChart(data, opts);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:5,代码来源:MemoryLineChart.java


示例14: createChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
@Override
public CoreChart createChart(DataTable data, Options opts) {
    return new PieChart(data, opts);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:5,代码来源:DiskPieChart.java


示例15: createChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
@Override
public CoreChart createChart(DataTable data, Options opts) {
    return new AreaChart(data, opts);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:5,代码来源:MBeanTimeAreaChart.java


示例16: updateTimelineChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
protected void updateTimelineChart(DataTable dataTable) {
    m_timeline.draw(dataTable, createTimelineOptions());
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:4,代码来源:Application.java


示例17: createChart

import com.google.gwt.visualization.client.DataTable; //导入依赖的package包/类
public abstract CoreChart createChart(DataTable data, Options opts); 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:2,代码来源:MBeanChart.java



注:本文中的com.google.gwt.visualization.client.DataTable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TimestampType类代码示例发布时间:2022-05-23
下一篇:
Java CTRSP800DRBG类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap