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


Java BarRenderer类代码示例

本文整理汇总了Java中de.erichseifert.gral.plots.BarPlot.BarRenderer的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer类的具体用法?Java BarRenderer怎么用?Java BarRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BarRenderer类属于de.erichseifert.gral.plots.BarPlot包,在下文中一共展示了BarRenderer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import de.erichseifert.gral.plots.BarPlot.BarRenderer; //导入依赖的package包/类
@Before
public void setUp() {
	DataSource data = new DummyData(2, 1, 1.0);
	plot = new MockBarPlot(data);

	BarRenderer pointRenderer = (BarRenderer) plot.getPointRenderers(data).get(0);
	pointRenderer.setBorderStroke(new BasicStroke());
}
 
开发者ID:eseifert,项目名称:gral,代码行数:9,代码来源:BarPlotTest.java

示例2: testPointRendererSerialization

import de.erichseifert.gral.plots.BarPlot.BarRenderer; //导入依赖的package包/类
private static void testPointRendererSerialization(
		List<PointRenderer> originalRenderers, List<PointRenderer> deserializedRenderers) {
	for (int rendererIndex = 0; rendererIndex < originalRenderers.size(); rendererIndex++) {
		BarRenderer original = (BarRenderer) originalRenderers.get(rendererIndex);
		BarRenderer deserialized = (BarRenderer) deserializedRenderers.get(rendererIndex);
		assertEquals(original.getBorderStroke(), deserialized.getBorderStroke());
		assertEquals(original.getBorderColor(), deserialized.getBorderColor());
	}
}
 
开发者ID:eseifert,项目名称:gral,代码行数:10,代码来源:BarPlotTest.java

示例3: SimpleBarPlot

import de.erichseifert.gral.plots.BarPlot.BarRenderer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SimpleBarPlot() {
	// Create example data
	DataTable data = new DataTable(Double.class, Integer.class, String.class);
	data.add(0.1,  1, "January");
	data.add(0.2,  3, "February");
	data.add(0.3, -2, "March");
	data.add(0.4,  6, "April");
	data.add(0.5, -4, "May");
	data.add(0.6,  8, "June");
	data.add(0.7,  9, "July");
	data.add(0.8, 11, "August");

	// Create new bar plot
	BarPlot plot = new BarPlot(data);

	// Format plot
	plot.setInsets(new Insets2D.Double(40.0, 40.0, 40.0, 40.0));
	plot.setBarWidth(0.075);

	// Format bars
	BarRenderer pointRenderer = (BarRenderer) plot.getPointRenderer(data);
	pointRenderer.setColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { COLOR1, GraphicsUtils.deriveBrighter(COLOR1) }
		)
	);
	/*pointRenderer.setBorderStroke(new BasicStroke(3f));
	pointRenderer.setBorderColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { GraphicsUtils.deriveBrighter(COLOR1), COLOR1 }
		)
	);*/
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColumn(2);
	pointRenderer.setValueLocation(Location.CENTER);
	pointRenderer.setValueColor(GraphicsUtils.deriveDarker(COLOR1));
pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

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

示例4: SimpleBarPlot

import de.erichseifert.gral.plots.BarPlot.BarRenderer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SimpleBarPlot() {
	// Create example data
	DataTable data = new DataTable(Double.class, Integer.class, String.class);
	data.add(0.1,  1, "January");
	data.add(0.2,  3, "February");
	data.add(0.3, -2, "March");
	data.add(0.4,  6, "April");
	data.add(0.5, -4, "May");
	data.add(0.6,  8, "June");
	data.add(0.7,  9, "July");
	data.add(0.8, 11, "August");

	// Create new bar plot
	BarPlot plot = new BarPlot(data);

	// Format plot
	plot.setInsets(new Insets2D.Double(40.0, 40.0, 40.0, 40.0));
	plot.setBarWidth(0.075);

	// Format bars
	BarRenderer pointRenderer = (BarRenderer) plot.getPointRenderers(data).get(0);
	pointRenderer.setColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { COLOR1, GraphicsUtils.deriveBrighter(COLOR1) }
		)
	);
	pointRenderer.setBorderStroke(new BasicStroke(3f));
	pointRenderer.setBorderColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { GraphicsUtils.deriveBrighter(COLOR1), COLOR1 }
		)
	);
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColumn(2);
	pointRenderer.setValueLocation(Location.CENTER);
	pointRenderer.setValueColor(GraphicsUtils.deriveDarker(COLOR1));
	pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

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

示例5: SimpleBarPlot

import de.erichseifert.gral.plots.BarPlot.BarRenderer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SimpleBarPlot() {
	// Create example data
	DataTable data = new DataTable(Double.class, Integer.class, String.class);
	data.add(0.1,  1, "January");
	data.add(0.2,  3, "February");
	data.add(0.3, -2, "March");
	data.add(0.4,  6, "April");
	data.add(0.5, -4, "May");
	data.add(0.6,  8, "June");
	data.add(0.7,  9, "July");
	data.add(0.8, 11, "August");

	// Create new bar plot
	BarPlot plot = new BarPlot(data);

	// Format plot
	plot.setInsets(new Insets2D.Double(40.0, 40.0, 40.0, 40.0));
	plot.setBarWidth(0.075);

	// Format bars
	BarRenderer pointRenderer = (BarRenderer) plot.getPointRenderer(data);
	pointRenderer.setColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { COLOR1, GraphicsUtils.deriveBrighter(COLOR1) }
		)
	);
	pointRenderer.setBorderStroke(new BasicStroke(3f));
	pointRenderer.setBorderColor(
		new LinearGradientPaint(0f,0f, 0f,1f,
				new float[] { 0.0f, 1.0f },
				new Color[] { GraphicsUtils.deriveBrighter(COLOR1), COLOR1 }
		)
	);
	pointRenderer.setValueVisible(true);
	pointRenderer.setValueColumn(2);
	pointRenderer.setValueLocation(Location.CENTER);
	pointRenderer.setValueColor(GraphicsUtils.deriveDarker(COLOR1));
	pointRenderer.setValueFont(Font.decode(null).deriveFont(Font.BOLD));

	// Add plot to Swing component
	add(new InteractivePanel(plot));
}
 
开发者ID:arahusky,项目名称:performance_javadoc,代码行数:45,代码来源:SimpleBarPlot.java


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