当前位置: 首页>>代码示例>>Java>>正文


Java PieSliceRenderer.setValueVisible方法代码示例

本文整理汇总了Java中de.erichseifert.gral.plots.PiePlot.PieSliceRenderer.setValueVisible方法的典型用法代码示例。如果您正苦于以下问题:Java PieSliceRenderer.setValueVisible方法的具体用法?Java PieSliceRenderer.setValueVisible怎么用?Java PieSliceRenderer.setValueVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.erichseifert.gral.plots.PiePlot.PieSliceRenderer的用法示例。


在下文中一共展示了PieSliceRenderer.setValueVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SimplePiePlot

import de.erichseifert.gral.plots.PiePlot.PieSliceRenderer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public SimplePiePlot() {
	// Create data
	DataTable data = new DataTable(Integer.class);
	for (int i = 0; i < SAMPLE_COUNT; i++) {
		int val = random.nextInt(8) + 2;
		data.add((random.nextDouble() <= 0.15) ? -val : val);
	}

	// Create new pie plot
	PiePlot plot = new PiePlot(data);

	// Format plot
	plot.getTitle().setText(getDescription());
	// Change relative size of pie
	plot.setRadius(0.9);
	// Display a legend
	plot.setLegendVisible(true);
	// Add some margin to the plot area
	plot.setInsets(new Insets2D.Double(20.0, 40.0, 40.0, 40.0));

	PieSliceRenderer pointRenderer =
			(PieSliceRenderer) plot.getPointRenderer(data);
	// Change relative size of inner region
	pointRenderer.setInnerRadius(0.4);
	// Change the width of gaps between segments
	pointRenderer.setGap(0.2);
	// Change the colors
	LinearGradient colors = new LinearGradient(COLOR1, COLOR2);
	pointRenderer.setColor(colors);
	// Show labels
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColor(Color.WHITE);
	pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

	// Add plot to Swing component
	add(new InteractivePanel(plot), BorderLayout.CENTER);
}
 
开发者ID:PacktPublishing,项目名称:Java-Data-Science-Cookbook,代码行数:39,代码来源:SimplePiePlot.java

示例2: SimplePiePlot

import de.erichseifert.gral.plots.PiePlot.PieSliceRenderer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public SimplePiePlot() {
	// Create data
	DataTable data = new DataTable(Integer.class);
	for (int i = 0; i < SAMPLE_COUNT; i++) {
		int val = random.nextInt(8) + 2;
		data.add((random.nextDouble() <= 0.15) ? -val : val);
	}
	DataSource pieData = PiePlot.createPieData(data);

	// Create new pie plot
	PiePlot plot = new PiePlot(pieData);

	// Format plot
	plot.getTitle().setText(getDescription());
	// Change relative size of pie
	plot.setRadius(0.9);
	// Display a legend
	plot.setLegendVisible(true);
	// Add some margin to the plot area
	plot.setInsets(new Insets2D.Double(20.0, 40.0, 40.0, 40.0));

	PieSliceRenderer pointRenderer =
			(PieSliceRenderer) plot.getPointRenderer(pieData);
	// Change relative size of inner region
	pointRenderer.setInnerRadius(0.4);
	// Change the width of gaps between segments
	pointRenderer.setGap(0.2);
	// Change the colors
	LinearGradient colors = new LinearGradient(COLOR1, COLOR2);
	pointRenderer.setColor(colors);
	// Show labels
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColor(Color.WHITE);
	pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

	// Add plot to Swing component
	add(new InteractivePanel(plot), BorderLayout.CENTER);
}
 
开发者ID:eseifert,项目名称:gral,代码行数:40,代码来源:SimplePiePlot.java

示例3: SimplePiePlot

import de.erichseifert.gral.plots.PiePlot.PieSliceRenderer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public SimplePiePlot() {
	// Create data
	DataTable data = new DataTable(Integer.class);
	for (int i = 0; i < SAMPLE_COUNT; i++) {
		int val = random.nextInt(8) + 2;
           int sign = (random.nextDouble() <= 0.15) ? -1 : 1;
           System.out.println("SimplePiePlot.SimplePiePlot(" + val  + ", " + sign + ")");
           data.add(val);
	}

	// Create new pie plot
	PiePlot plot = new PiePlot(data);

	// Format plot
	plot.getTitle().setText(getDescription());
	// Change relative size of pie
	plot.setRadius(0.9);
	// Display a legend
	plot.setLegendVisible(true);
	// Add some margin to the plot area
	plot.setInsets(new Insets2D.Double(20.0, 40.0, 40.0, 40.0));

	PieSliceRenderer pointRenderer =
			(PieSliceRenderer) plot.getPointRenderer(data);
	// Change relative size of inner region
	pointRenderer.setInnerRadius(0.4);
	// Change the width of gaps between segments
	pointRenderer.setGap(0.2);
	// Change the colors
	LinearGradient colors = new LinearGradient(COLOR1, COLOR2);
	pointRenderer.setColor(colors);
	// Show labels
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColor(Color.WHITE);
	pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

	// Add plot to Swing component
	add(new InteractivePanel(plot), BorderLayout.CENTER);
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:41,代码来源:SimplePiePlot.java


注:本文中的de.erichseifert.gral.plots.PiePlot.PieSliceRenderer.setValueVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。