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


Java HighLowRenderer类代码示例

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


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

示例1: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code> permitted).
 * @param valueAxisLabel  a label for the value axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return a high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title,
                                            String timeAxisLabel,
                                            String valueAxisLabel,
                                            OHLCDataset dataset,
                                            boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:ChartFactory.java

示例2: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code> 
 *                       permitted).
 * @param valueAxisLabel  a label for the value axis (<code>null</code> 
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title,
                                            String timeAxisLabel,
                                            String valueAxisLabel,
                                            OHLCDataset dataset,
                                            boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:ChartFactory.java

示例3: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code>
 *                       permitted).
 * @param valueAxisLabel  a label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title,
        String timeAxisLabel, String valueAxisLabel, OHLCDataset dataset,
        boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:29,代码来源:ChartFactory.java

示例4: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title ({@code null} permitted).
 * @param timeAxisLabel  a label for the time axis ({@code null}
 *                       permitted).
 * @param valueAxisLabel  a label for the value axis ({@code null}
 *                        permitted).
 * @param dataset  the dataset for the chart ({@code null} permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title,
        String timeAxisLabel, String valueAxisLabel, OHLCDataset dataset,
        boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setDefaultToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:29,代码来源:ChartFactory.java

示例5: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code>
 *                       permitted).
 * @param valueAxisLabel  a label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title,
                                            String timeAxisLabel,
                                            String valueAxisLabel,
                                            OHLCDataset dataset,
                                            boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:31,代码来源:ChartFactory.java

示例6: testHashcode

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    HighLowRenderer r1 = new HighLowRenderer();
    HighLowRenderer r2 = new HighLowRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:HighLowRendererTests.java

示例7: testEquals

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    HighLowRenderer r1 = new HighLowRenderer();
    HighLowRenderer r2 = new HighLowRenderer();
    assertEquals(r1, r2);
    
    // drawOpenTicks
    r1.setDrawOpenTicks(false);
    assertFalse(r1.equals(r2));
    r2.setDrawOpenTicks(false);
    assertTrue(r1.equals(r2));
    
    // drawCloseTicks
    r1.setDrawCloseTicks(false);
    assertFalse(r1.equals(r2));
    r2.setDrawCloseTicks(false);
    assertTrue(r1.equals(r2));
    
    // openTickPaint
    r1.setOpenTickPaint(Color.red);
    assertFalse(r1.equals(r2));
    r2.setOpenTickPaint(Color.red);
    assertTrue(r1.equals(r2));
    
    // closeTickPaint
    r1.setCloseTickPaint(Color.blue);
    assertFalse(r1.equals(r2));
    r2.setCloseTickPaint(Color.blue);
    assertTrue(r1.equals(r2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:HighLowRendererTests.java

示例8: testEquals

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    HighLowRenderer r1 = new HighLowRenderer();
    HighLowRenderer r2 = new HighLowRenderer();
    assertEquals(r1, r2);

    // drawOpenTicks
    r1.setDrawOpenTicks(false);
    assertFalse(r1.equals(r2));
    r2.setDrawOpenTicks(false);
    assertTrue(r1.equals(r2));

    // drawCloseTicks
    r1.setDrawCloseTicks(false);
    assertFalse(r1.equals(r2));
    r2.setDrawCloseTicks(false);
    assertTrue(r1.equals(r2));

    // openTickPaint
    r1.setOpenTickPaint(Color.red);
    assertFalse(r1.equals(r2));
    r2.setOpenTickPaint(Color.red);
    assertTrue(r1.equals(r2));

    // closeTickPaint
    r1.setCloseTickPaint(Color.blue);
    assertFalse(r1.equals(r2));
    r2.setCloseTickPaint(Color.blue);
    assertTrue(r1.equals(r2));

    // tickLength
    r1.setTickLength(99.9);
    assertFalse(r1.equals(r2));
    r2.setTickLength(99.9);
    assertTrue(r1.equals(r2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:39,代码来源:HighLowRendererTests.java

示例9: testHashcode

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    HighLowRenderer r1 = new HighLowRenderer();
    HighLowRenderer r2 = new HighLowRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:HighLowRendererTests.java

示例10: test

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
@Override
public void test() {
	super.test();

	numberOfPagesTest(1);

	JFreeChart chart = getChart("summary.chart1", 0);
	XYItemRenderer renderer = chart.getXYPlot().getRenderer();
	Assert.assertEquals("renderer", HighLowRenderer.class, renderer.getClass());
	Assert.assertEquals("show open ticks", true, ((HighLowRenderer) renderer).getDrawOpenTicks());
	Assert.assertEquals("show close ticks", true, ((HighLowRenderer) renderer).getDrawCloseTicks());
	highLowChartDataTest(chart, 0, new Object[][] {
			{"serie", date1, 50d, 35d, 40d, 47d, 70d}, {"serie", date2, 55d, 40d, 50d, 45d, 120d}, {"serie", date3, 48d, 41d, 42d, 47d, 90d}});

	chart = getChart("summary.chart2", 0);
	Axis axis = chart.getXYPlot().getDomainAxis();
	Assert.assertEquals("category label", "time", axis.getLabel());
	Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
	Assert.assertTrue("vertical tick labels", ((ValueAxis) axis).isVerticalTickLabels());

	chart = getChart("summary.chart3", 0);
	axis = chart.getXYPlot().getRangeAxis();
	Assert.assertEquals("value label", "value", axis.getLabel());
	Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10));
	//Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
	Assert.assertEquals("range min value", 1d, ((ValueAxis) axis).getLowerBound());
	Assert.assertEquals("range max value", 15d, ((ValueAxis) axis).getUpperBound());
	Assert.assertTrue("vertical tick labels", ((ValueAxis) axis).isVerticalTickLabels());
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:38,代码来源:HighLowChartTest.java

示例11: testEquals

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 * Problem that the equals(...) method distinguishes all fields.
 */
public void testEquals() {
    HighLowRenderer r1 = new HighLowRenderer();
    HighLowRenderer r2 = new HighLowRenderer();
    assertEquals(r1, r2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:HighLowRendererTests.java

示例12: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 *
 * @param evaluation
 * @throws JRException
 */
protected JFreeChart createHighLowChart() throws JRException
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createHighLowChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getTimeAxisLabelExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getValueAxisLabelExpression()),
			(DefaultHighLowDataset)getDataset(),
			isShowLegend()
			);

	configureChart(jfreeChart, getPlot());
	XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
	JRHighLowPlot highLowPlot = (JRHighLowPlot)getPlot();
	HighLowRenderer hlRenderer = (HighLowRenderer) xyPlot.getRenderer();
	boolean isShowOpenTicks = highLowPlot.getShowOpenTicks() == null ? false : highLowPlot.getShowOpenTicks().booleanValue();
	boolean isShowCloseTicks = highLowPlot.getShowCloseTicks() == null ? false : highLowPlot.getShowCloseTicks().booleanValue();
	
	hlRenderer.setDrawOpenTicks(isShowOpenTicks);
	hlRenderer.setDrawCloseTicks(isShowCloseTicks);

	// Handle the axis formating for the category axis
	configureAxis(xyPlot.getDomainAxis(), highLowPlot.getTimeAxisLabelFont(),
			highLowPlot.getTimeAxisLabelColor(), highLowPlot.getTimeAxisTickLabelFont(),
			highLowPlot.getTimeAxisTickLabelColor(), highLowPlot.getTimeAxisTickLabelMask(), highLowPlot.getTimeAxisVerticalTickLabels(),
			highLowPlot.getOwnTimeAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(xyPlot.getRangeAxis(), highLowPlot.getValueAxisLabelFont(),
			highLowPlot.getValueAxisLabelColor(), highLowPlot.getValueAxisTickLabelFont(),
			highLowPlot.getValueAxisTickLabelColor(), highLowPlot.getValueAxisTickLabelMask(), highLowPlot.getValueAxisVerticalTickLabels(),
			highLowPlot.getOwnValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMaxValueExpression()));
	
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:46,代码来源:GenericChartTheme.java

示例13: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 *
 * @param evaluation
 * @throws JRException
 */
protected JFreeChart createHighLowChart() throws JRException
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createHighLowChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getTimeAxisLabelExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getValueAxisLabelExpression()),
			(DefaultHighLowDataset)getDataset(),
			isShowLegend()
			);

	configureChart(jfreeChart, getPlot());
	XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
	JRHighLowPlot highLowPlot = (JRHighLowPlot)getPlot();
	HighLowRenderer hlRenderer = (HighLowRenderer) xyPlot.getRenderer();
	boolean isShowOpenTicks = highLowPlot.getShowOpenTicks() == null ? false : highLowPlot.getShowOpenTicks().booleanValue();
	boolean isShowCloseTicks = highLowPlot.getShowCloseTicks() == null ? false : highLowPlot.getShowCloseTicks().booleanValue();
	
	hlRenderer.setDrawOpenTicks(isShowOpenTicks);
	hlRenderer.setDrawCloseTicks(isShowCloseTicks);

	// Handle the axis formating for the category axis
	configureAxis(xyPlot.getDomainAxis(), highLowPlot.getTimeAxisLabelFont(),
			highLowPlot.getTimeAxisLabelColor(), highLowPlot.getTimeAxisTickLabelFont(),
			highLowPlot.getTimeAxisTickLabelColor(), highLowPlot.getTimeAxisTickLabelMask(), highLowPlot.getTimeAxisVerticalTickLabels(),
			highLowPlot.getOwnTimeAxisLineColor(), getDomainAxisSettings(),
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMaxValueExpression())
			);

	// Handle the axis formating for the value axis
	configureAxis(xyPlot.getRangeAxis(), highLowPlot.getValueAxisLabelFont(),
			highLowPlot.getValueAxisLabelColor(), highLowPlot.getValueAxisTickLabelFont(),
			highLowPlot.getValueAxisTickLabelColor(), highLowPlot.getValueAxisTickLabelMask(), highLowPlot.getValueAxisVerticalTickLabels(),
			highLowPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMaxValueExpression())
			);
	
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:48,代码来源:SimpleChartTheme.java

示例14: createHighLowChart

import org.jfree.chart.renderer.xy.HighLowRenderer; //导入依赖的package包/类
/**
 *
 */
protected JFreeChart createHighLowChart() throws JRException
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createHighLowChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getTimeAxisLabelExpression()),
			evaluateTextExpression(((JRHighLowPlot)getPlot()).getValueAxisLabelExpression()),
			(DefaultHighLowDataset)getDataset(),
			isShowLegend()
			);

	configureChart(jfreeChart);

	XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
	JRHighLowPlot highLowPlot = (JRHighLowPlot)getPlot();
	HighLowRenderer hlRenderer = (HighLowRenderer) xyPlot.getRenderer();
	boolean isShowOpenTicks = highLowPlot.getShowOpenTicks() == null ? false : highLowPlot.getShowOpenTicks().booleanValue();
	boolean isShowCloseTicks = highLowPlot.getShowCloseTicks() == null ? false : highLowPlot.getShowCloseTicks().booleanValue();
	
	hlRenderer.setDrawOpenTicks(isShowOpenTicks);
	hlRenderer.setDrawCloseTicks(isShowCloseTicks);

	// Handle the axis formating for the category axis
	configureAxis(xyPlot.getDomainAxis(), highLowPlot.getTimeAxisLabelFont(),
			highLowPlot.getTimeAxisLabelColor(), highLowPlot.getTimeAxisTickLabelFont(),
			highLowPlot.getTimeAxisTickLabelColor(), highLowPlot.getTimeAxisTickLabelMask(), highLowPlot.getTimeAxisVerticalTickLabels(),
			highLowPlot.getTimeAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(highLowPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(xyPlot.getRangeAxis(), highLowPlot.getValueAxisLabelFont(),
			highLowPlot.getValueAxisLabelColor(), highLowPlot.getValueAxisTickLabelFont(),
			highLowPlot.getValueAxisTickLabelColor(), highLowPlot.getValueAxisTickLabelMask(), highLowPlot.getValueAxisVerticalTickLabels(),
			highLowPlot.getValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(highLowPlot.getRangeAxisMaxValueExpression()));
	
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:45,代码来源:DefaultChartTheme.java


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