本文整理匯總了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setBaseLinesVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java XYLineAndShapeRenderer.setBaseLinesVisible方法的具體用法?Java XYLineAndShapeRenderer.setBaseLinesVisible怎麽用?Java XYLineAndShapeRenderer.setBaseLinesVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setBaseLinesVisible方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createLegend
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createLegend(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // url
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
XYPlot plot = (XYPlot) chart.getPlot();
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseLinesVisible(false);
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
plot.setRenderer(renderer);
return chart;
}
示例2: createScatterChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
@Override
protected JFreeChart createScatterChart() throws JRException
{
JFreeChart jfreeChart = super.createScatterChart();
XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
xyPlot.setRangeGridlinePaint(SCATTER_GRIDLINE_COLOR);
xyPlot.setRangeGridlineStroke(new BasicStroke(0.75f));
xyPlot.setDomainGridlinesVisible(true);
xyPlot.setDomainGridlinePaint(SCATTER_GRIDLINE_COLOR);
xyPlot.setDomainGridlineStroke(new BasicStroke(0.75f));
xyPlot.setRangeZeroBaselinePaint(ChartThemesConstants.GRAY_PAINT_134);
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
lineRenderer.setUseFillPaint(true);
JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
boolean isShowLines = scatterPlot.getShowLines() == null ? false : scatterPlot.getShowLines().booleanValue();
lineRenderer.setBaseLinesVisible(isShowLines);
XYDataset xyDataset = xyPlot.getDataset();
if (xyDataset != null)
{
for (int i = 0; i < xyDataset.getSeriesCount(); i++)
{
lineRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
lineRenderer.setSeriesFillPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
lineRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(i));
//lineRenderer.setSeriesShape(i, new Ellipse2D.Double(-3, -3, 6, 6));
}
}
return jfreeChart;
}
示例3: TimeSeriesChartContainer
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public TimeSeriesChartContainer()
{
dataset = new DefaultXYDataset();
renderer = new XYLineAndShapeRenderer();
renderer.setBaseShapesVisible(false);
renderer.setBaseLinesVisible(true);
XYPlot plot = new XYPlot(dataset, new NumberAxis("Time"), new NumberAxis(), renderer);
chart = new JFreeChart(plot);
plot.setDrawingSupplier(ChartUtils.createDrawingSupplier());
}
示例4: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private void createChart(){
JFreeChart chart = ChartFactory.createXYLineChart(
"plotting", // chart title
"X Axis", // x axis label
"Y Axis", // y axis label
createMultiple(datas.length), // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
true // urls
);
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setBaseShapesVisible(false);
renderer.setBaseLinesVisible(true);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setRenderer(renderer);
if(annotation != null){
for (int i = 1; i < annotation.length; i++) {
plot.addAnnotation(annotation[i]);
}
}
ChartFrame frame = new ChartFrame("Multiple Plot", chart);
// frame.getChartPanel().setRangeZoomable(false);
frame.setVisible(true);
frame.pack();
}
示例5: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
// renderer.setSeriesLinesVisible(0, false);
// renderer.setSeriesShapesVisible(1, false);
renderer.setBaseLinesVisible(false);
plot.setRenderer(renderer);
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// OPTIONAL CUSTOMISATION COMPLETED.
return chart;
}
示例6: createXYSymbolicAxisChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private JFreeChart createXYSymbolicAxisChart(String title, XYDataset dataset) {
SymbolAxis domainAxis = new SymbolAxis("Domain",
new String[] {"A", "B", "C", "D"});
SymbolAxis rangeAxis = new SymbolAxis("Range",
new String[] {"V", "X", "Y", "Z"});
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
//renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
JFreeChart chart = new JFreeChart("SymbolicAxis Demo 1", plot);
if (lineCondition.indexOf("noshape")!=-1)
renderer.setBaseShapesVisible(false);
else renderer.setBaseShapesVisible(true);
if (lineCondition.indexOf("noline")!=-1)
renderer.setBaseLinesVisible(false);
if (lineCondition.indexOf("nofill")!=-1){
renderer.setBaseShapesFilled(false);
renderer.setBaseFillPaint(Color.white);
renderer.setDrawOutlines(true);}
else {
renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(false);
}
renderer.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);
return chart;
}
示例7: testEquals
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
assertEquals(r1, r2);
assertEquals(r2, r1);
r1.setLinesVisible(true);
assertFalse(r1.equals(r2));
r2.setLinesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesLinesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesLinesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setBaseLinesVisible(false);
assertFalse(r1.equals(r2));
r2.setBaseLinesVisible(false);
assertTrue(r1.equals(r2));
r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
assertFalse(r1.equals(r2));
r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
assertTrue(r1.equals(r2));
r1.setShapesVisible(true);
assertFalse(r1.equals(r2));
r2.setShapesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setBaseShapesVisible(false);
assertFalse(r1.equals(r2));
r2.setBaseShapesVisible(false);
assertTrue(r1.equals(r2));
r1.setShapesFilled(true);
assertFalse(r1.equals(r2));
r2.setShapesFilled(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesFilled(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesFilled(3, true);
assertTrue(r1.equals(r2));
r1.setBaseShapesFilled(false);
assertFalse(r1.equals(r2));
r2.setBaseShapesFilled(false);
assertTrue(r1.equals(r2));
r1.setDrawOutlines(!r1.getDrawOutlines());
assertFalse(r1.equals(r2));
r2.setDrawOutlines(r1.getDrawOutlines());
assertTrue(r1.equals(r2));
r1.setUseOutlinePaint(true);
assertFalse(r1.equals(r2));
r2.setUseOutlinePaint(true);
assertTrue(r1.equals(r2));
r1.setUseFillPaint(true);
assertFalse(r1.equals(r2));
r2.setUseFillPaint(true);
assertTrue(r1.equals(r2));
r1.setDrawSeriesLineAsPath(true);
assertFalse(r1.equals(r2));
r2.setDrawSeriesLineAsPath(true);
assertTrue(r1.equals(r2));
}
示例8: createScatterChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createScatterChart() throws JRException
{
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createScatterPlot(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression()),
(XYDataset)getDataset(),
getPlot().getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart, getPlot());
XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();
JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
plotRenderer.setBaseLinesVisible(isShowLines);
plotRenderer.setBaseShapesVisible(isShowShapes);
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
scatterPlot.getOwnXAxisLineColor(), false,
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
scatterPlot.getOwnYAxisLineColor(), true,
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));
return jfreeChart;
}
示例9: createXyLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createXyLineChart() throws JRException
{
JRLinePlot linePlot = (JRLinePlot) getPlot();
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createXYLineChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
evaluateTextExpression(linePlot.getValueAxisLabelExpression()),
(XYDataset)getDataset(),
linePlot.getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart, getPlot());
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
linePlot.getOwnCategoryAxisLineColor(), false,
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
linePlot.getOwnValueAxisLineColor(), true,
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
lineRenderer.setBaseShapesVisible(isShowShapes);
lineRenderer.setBaseLinesVisible(isShowLines);
return jfreeChart;
}
示例10: createTimeSeriesChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createTimeSeriesChart() throws JRException
{
String timeAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getTimeAxisLabelExpression());
String valueAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getValueAxisLabelExpression());
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createTimeSeriesChart(
evaluateTextExpression(getChart().getTitleExpression()),
timeAxisLabel,
valueAxisLabel,
(TimeSeriesCollection)getDataset(),
isShowLegend(),
true,
false );
configureChart(jfreeChart, getPlot());
XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot)getPlot();
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes().booleanValue();
boolean isShowLines = timeSeriesPlot.getShowLines() == null ? true : timeSeriesPlot.getShowLines().booleanValue();
lineRenderer.setBaseLinesVisible(isShowLines);
lineRenderer.setBaseShapesVisible(isShowShapes);
// Handle the axis formating for the category axis
configureAxis(xyPlot.getDomainAxis(), timeSeriesPlot.getTimeAxisLabelFont(),
timeSeriesPlot.getTimeAxisLabelColor(), timeSeriesPlot.getTimeAxisTickLabelFont(),
timeSeriesPlot.getTimeAxisTickLabelColor(), timeSeriesPlot.getTimeAxisTickLabelMask(), timeSeriesPlot.getTimeAxisVerticalTickLabels(),
timeSeriesPlot.getOwnTimeAxisLineColor(), false,
(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(xyPlot.getRangeAxis(), timeSeriesPlot.getValueAxisLabelFont(),
timeSeriesPlot.getValueAxisLabelColor(), timeSeriesPlot.getValueAxisTickLabelFont(),
timeSeriesPlot.getValueAxisTickLabelColor(), timeSeriesPlot.getValueAxisTickLabelMask(), timeSeriesPlot.getValueAxisVerticalTickLabels(),
timeSeriesPlot.getOwnValueAxisLineColor(), true,
(Comparable<?>)evaluateExpression(timeSeriesPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(timeSeriesPlot.getRangeAxisMaxValueExpression()));
return jfreeChart;
}
示例11: createScatterChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createScatterChart() throws JRException
{
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createScatterPlot(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression()),
(XYDataset)getDataset(),
getPlot().getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart, getPlot());
XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();
JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
plotRenderer.setBaseLinesVisible(isShowLines);
plotRenderer.setBaseShapesVisible(isShowShapes);
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
scatterPlot.getOwnXAxisLineColor(), getDomainAxisSettings(),
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
scatterPlot.getOwnYAxisLineColor(), getRangeAxisSettings(),
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));
return jfreeChart;
}
示例12: createXyLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createXyLineChart() throws JRException
{
JRLinePlot linePlot = (JRLinePlot) getPlot();
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createXYLineChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
evaluateTextExpression(linePlot.getValueAxisLabelExpression()),
(XYDataset)getDataset(),
linePlot.getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart, getPlot());
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
linePlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression())
);
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
linePlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression())
);
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
lineRenderer.setBaseShapesVisible(isShowShapes);
lineRenderer.setBaseLinesVisible(isShowLines);
return jfreeChart;
}
示例13: createTimeSeriesChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createTimeSeriesChart() throws JRException
{
String timeAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getTimeAxisLabelExpression());
String valueAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getValueAxisLabelExpression());
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createTimeSeriesChart(
evaluateTextExpression(getChart().getTitleExpression()),
timeAxisLabel,
valueAxisLabel,
(TimeSeriesCollection)getDataset(),
isShowLegend(),
true,
false );
configureChart(jfreeChart, getPlot());
XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot)getPlot();
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes().booleanValue();
boolean isShowLines = timeSeriesPlot.getShowLines() == null ? true : timeSeriesPlot.getShowLines().booleanValue();
lineRenderer.setBaseLinesVisible(isShowLines);
lineRenderer.setBaseShapesVisible(isShowShapes);
// Handle the axis formating for the category axis
configureAxis(xyPlot.getDomainAxis(), timeSeriesPlot.getTimeAxisLabelFont(),
timeSeriesPlot.getTimeAxisLabelColor(), timeSeriesPlot.getTimeAxisTickLabelFont(),
timeSeriesPlot.getTimeAxisTickLabelColor(), timeSeriesPlot.getTimeAxisTickLabelMask(), timeSeriesPlot.getTimeAxisVerticalTickLabels(),
timeSeriesPlot.getOwnTimeAxisLineColor(), getDomainAxisSettings(), DateTickUnitType.DAY,
(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMaxValueExpression())
);
// Handle the axis formating for the value axis
configureAxis(xyPlot.getRangeAxis(), timeSeriesPlot.getValueAxisLabelFont(),
timeSeriesPlot.getValueAxisLabelColor(), timeSeriesPlot.getValueAxisTickLabelFont(),
timeSeriesPlot.getValueAxisTickLabelColor(), timeSeriesPlot.getValueAxisTickLabelMask(), timeSeriesPlot.getValueAxisVerticalTickLabels(),
timeSeriesPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(), DateTickUnitType.DAY,
(Comparable<?>)evaluateExpression(timeSeriesPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(timeSeriesPlot.getRangeAxisMaxValueExpression())
);
return jfreeChart;
}
示例14: createScatterChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createScatterChart() throws JRException
{
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart = ChartFactory.createScatterPlot(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression() ),
(XYDataset)getDataset(),
getPlot().getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart);
XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();
JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
plotRenderer.setBaseLinesVisible(isShowLines);
plotRenderer.setBaseShapesVisible(isShowShapes);
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
scatterPlot.getXAxisLineColor(), false,
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
scatterPlot.getYAxisLineColor(), true,
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));
return jfreeChart;
}
示例15: createXyLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createXyLineChart() throws JRException
{
JRLinePlot linePlot = (JRLinePlot) getPlot();
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createXYLineChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
evaluateTextExpression(linePlot.getValueAxisLabelExpression() ),
(XYDataset)getDataset(),
linePlot.getOrientationValue().getOrientation(),
isShowLegend(),
true,
false);
configureChart(jfreeChart);
// Handle the axis formating for the category axis
configureAxis(jfreeChart.getXYPlot().getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
linePlot.getCategoryAxisLineColor(), false,
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
linePlot.getValueAxisLineColor(), true,
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));
XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
lineRenderer.setBaseShapesVisible(isShowShapes);
lineRenderer.setBaseLinesVisible(isShowLines);
return jfreeChart;
}