本文整理汇总了Java中org.jfree.data.general.DefaultValueDataset类的典型用法代码示例。如果您正苦于以下问题:Java DefaultValueDataset类的具体用法?Java DefaultValueDataset怎么用?Java DefaultValueDataset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultValueDataset类属于org.jfree.data.general包,在下文中一共展示了DefaultValueDataset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDrawWithNullInfo
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Draws the chart with a single range. At one point, this caused a null
* pointer exception (fixed now).
*/
public void testDrawWithNullInfo() {
boolean success = false;
MeterPlot plot = new MeterPlot(new DefaultValueDataset(60.0));
plot.addInterval(new MeterInterval("Normal", new Range(0.0, 80.0)));
JFreeChart chart = new JFreeChart(plot);
try {
BufferedImage image = new BufferedImage(200, 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
g2.dispose();
success = true;
}
catch (Exception e) {
success = false;
}
assertTrue(success);
}
示例2: buildChart1
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
public void buildChart1() {
setColorLimits();
dataset = new DefaultValueDataset(10D);
JFreeChart jfreechart = createStandardDialChart(chartTitle, variableName, dataset, chartBottonLimit, chartTopLimit, majorDivisions, minorDivisions);
DialPlot dialplot = (DialPlot) jfreechart.getPlot();
StandardDialRange standarddialrange = new StandardDialRange(redBottomLimit, redTopLimit, Color.red);
standarddialrange.setInnerRadius(0.522D);
standarddialrange.setOuterRadius(0.554D);
dialplot.addLayer(standarddialrange);
StandardDialRange standarddialrange1 = new StandardDialRange(yellowBottomLimit, yellowTopLimit, Color.orange);
standarddialrange1.setInnerRadius(0.522D);
standarddialrange1.setOuterRadius(0.554D);
dialplot.addLayer(standarddialrange1);
StandardDialRange standarddialrange2 = new StandardDialRange(greenBottomLimit, greenTopLimit, Color.green);
standarddialrange2.setInnerRadius(0.522D);
standarddialrange2.setOuterRadius(0.554D);
dialplot.addLayer(standarddialrange2);
GradientPaint gradientpaint = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(170, 170, 220));
DialBackground dialbackground = new DialBackground(gradientpaint);
dialbackground.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
dialplot.setBackground(dialbackground);
dialplot.removePointer(0);
org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer();
dialplot.addPointer(pointer);
add(new ChartPanel(jfreechart));
}
示例3: buildChart2
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
public void buildChart2() {
dataset = new DefaultValueDataset(0);
DialPlot dialplot = new DialPlot();
dialplot.setView(0.20D, 0.0D, 0.6D, 0.3D);
dialplot.setDataset(dataset);
ArcDialFrame arcdialframe = new ArcDialFrame(60D, 60D);
arcdialframe.setInnerRadius(0.6D);
arcdialframe.setOuterRadius(0.9D);
arcdialframe.setForegroundPaint(Color.darkGray);
arcdialframe.setStroke(new BasicStroke(3F));
dialplot.setDialFrame(arcdialframe);
GradientPaint gradientpaint = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(240, 240, 240));
DialBackground dialbackground = new DialBackground(gradientpaint);
dialbackground.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
dialplot.addLayer(dialbackground);
StandardDialScale standarddialscale = new StandardDialScale(chartBottonLimit, chartTopLimit, 115D, -50D, majorDivisions, minorDivisions);
standarddialscale.setTickRadius(0.88D);
standarddialscale.setTickLabelOffset(0.07D);
dialplot.addScale(0, standarddialscale);
org.jfree.chart.plot.dial.DialPointer.Pin pin = new org.jfree.chart.plot.dial.DialPointer.Pin();
pin.setRadius(0.8D);
dialplot.addLayer(pin);
JFreeChart jfreechart = new JFreeChart(dialplot);
jfreechart.setTitle(chartTitle);
add(new ChartPanel(jfreechart));
}
示例4: buildPlot1
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
public void buildPlot1() {
setColorLimits();
dataset = new DefaultValueDataset(30);
ThermometerPlot thermometerplot = new ThermometerPlot(dataset);
thermometerplot.setRange(plotBottonLimit, plotTopLimit);
thermometerplot.setUnits(ThermometerPlot.UNITS_CELCIUS);
thermometerplot.setSubrange(0, greenBottomLimit, greenTopLimit);
thermometerplot.setSubrangePaint(0, Color.green);
thermometerplot.setSubrange(1, yellowBottomLimit, yellowTopLimit);
thermometerplot.setSubrangePaint(1, Color.yellow);
thermometerplot.setSubrange(2, redBottomLimit, redTopLimit);
thermometerplot.setSubrangePaint(2, Color.red);
JFreeChart jfreechart = new JFreeChart(plotTitle, thermometerplot);
ChartUtilities.applyCurrentTheme(jfreechart);
add(new ChartPanel(jfreechart));
}
示例5: createThermometerChart
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
private JFreeChart createThermometerChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
DefaultValueDataset dataset = createDefaultValueDataset(values);
ThermometerPlot plot = new ThermometerPlot(dataset);
plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setPadding(new RectangleInsets(10.0, 10.0, 10.0, 10.0));
plot.setThermometerStroke(new BasicStroke(2.0f));
plot.setThermometerPaint(Color.lightGray);
plot.setUnits(ThermometerPlot.UNITS_FAHRENHEIT);
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}
示例6: testDrawWithNullInfo
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Draws the chart with a single range. At one point, this caused a null
* pointer exception (fixed now).
*/
public void testDrawWithNullInfo() {
boolean success = false;
MeterPlot plot = new MeterPlot(new DefaultValueDataset(60.0));
plot.addInterval(new MeterInterval("Normal", new Range(0.0, 80.0)));
JFreeChart chart = new JFreeChart(plot);
try {
BufferedImage image = new BufferedImage(200, 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
g2.dispose();
success = true;
}
catch (Exception e) {
success = false;
}
assertTrue(success);
}
示例7: createMeterPlot
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/** Creates a meter plot and sets color values */
private MeterPlot createMeterPlot() {
MeterPlot plot = new MeterPlot(new DefaultValueDataset(value));
plot.setUnits(unit);
plot.setDialShape(DialShape.CHORD);
plot.setDialBackgroundPaint(Color.WHITE);
plot.setRange(new Range(0, redThreshold));
plot.setDialOutlinePaint(Color.GRAY);
plot.setNeedlePaint(Color.BLACK);
plot.setTickLabelsVisible(true);
plot.setTickLabelPaint(Color.BLACK);
plot.setTickPaint(Color.GRAY);
plot.setTickLabelFormat(NumberFormat.getNumberInstance());
plot.setTickSize(10);
plot.setValuePaint(Color.BLACK);
return plot;
}
示例8: createThermometerChart
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
private JFreeChart createThermometerChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
DefaultValueDataset dataset = createDefaultValueDataset(values);
ThermometerPlot plot = new ThermometerPlot(dataset);
plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setPadding(new RectangleInsets(10.0, 10.0, 10.0, 10.0));
plot.setThermometerStroke(new BasicStroke(2.0f));
plot.setThermometerPaint(Color.lightGray);
plot.setUnits(ThermometerPlot.UNITS_FAHRENHEIT);
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}
示例9: JThermometer
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Default constructor.
*/
public JThermometer() {
super(new CardLayout());
this.plot.setInsets(new Insets(5, 5, 5, 5));
this.data = new DefaultValueDataset();
//data.setRange(new Double(-60000), new Double(60000));
this.plot.setDataset(this.data);
this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, this.plot, false);
this.panel = new ChartPanel(this.chart);
add(this.panel, "Panel");
setBackground(getBackground());
}
示例10: JThermometer
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Default constructor.
*/
public JThermometer() {
super(new CardLayout());
this.plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
this.data = new DefaultValueDataset();
this.plot.setDataset(this.data);
this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT,
this.plot, false);
this.panel = new ChartPanel(this.chart);
add(this.panel, "Panel");
setBackground(getBackground());
}
示例11: testDrawWithNullInfo
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Draws the chart with a single range. At one point, this caused a null
* pointer exception (fixed now).
*/
@Test
public void testDrawWithNullInfo() {
MeterPlot plot = new MeterPlot(new DefaultValueDataset(60.0));
plot.addInterval(new MeterInterval("Normal", new Range(0.0, 80.0)));
JFreeChart chart = new JFreeChart(plot);
BufferedImage image = new BufferedImage(200, 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
g2.dispose();
//FIXME we should really assert a value here
}
示例12: testSerialization2
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization2() {
MeterPlot p1 = new MeterPlot(new DefaultValueDataset(1.23));
MeterPlot p2 = (MeterPlot) TestUtilities.serialised(p1);
assertEquals(p1, p2);
}
示例13: testCloning
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
CompassPlot p1 = new CompassPlot(new DefaultValueDataset(15.0));
CompassPlot p2 = (CompassPlot) p1.clone();
assertTrue(p1 != p2);
assertTrue(p1.getClass() == p2.getClass());
assertTrue(p1.equals(p2));
}
示例14: JThermometer
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Default constructor.
*/
public JThermometer() {
super(new CardLayout());
this.plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
this.data = new DefaultValueDataset();
this.plot.setDataset(this.data);
this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT,
this.plot, false);
this.panel = new ChartPanel(this.chart);
add(this.panel, "Panel");
setBackground(getBackground());
}
示例15: testSerialization2
import org.jfree.data.general.DefaultValueDataset; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization2() {
MeterPlot p1 = new MeterPlot(new DefaultValueDataset(1.23));
MeterPlot p2 = (MeterPlot) TestUtils.serialised(p1);
assertEquals(p1, p2);
}