本文整理匯總了Java中org.jfree.chart.labels.StandardXYToolTipGenerator類的典型用法代碼示例。如果您正苦於以下問題:Java StandardXYToolTipGenerator類的具體用法?Java StandardXYToolTipGenerator怎麽用?Java StandardXYToolTipGenerator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StandardXYToolTipGenerator類屬於org.jfree.chart.labels包,在下文中一共展示了StandardXYToolTipGenerator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setTimeSeriesBarRender
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
public static void setTimeSeriesBarRender(Plot plot, boolean isShowDataLabels) {
XYPlot xyplot = (XYPlot) plot;
xyplot.setNoDataMessage(NO_DATA_MSG);
XYBarRenderer xyRenderer = new XYBarRenderer(0.1D);
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
if (isShowDataLabels) {
xyRenderer.setBaseItemLabelsVisible(true);
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
}
StandardXYToolTipGenerator xyTooltipGenerator = new StandardXYToolTipGenerator("{1}:{2}", new SimpleDateFormat("yyyy-MM-dd"), new DecimalFormat("0"));
xyRenderer.setBaseToolTipGenerator(xyTooltipGenerator);
setXY_XAixs(xyplot);
setXY_YAixs(xyplot);
}
示例2: createWindPlot
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a wind plot with default settings.
*
* @param title the chart title (<code>null</code> permitted).
* @param xAxisLabel a label for the x-axis (<code>null</code> permitted).
* @param yAxisLabel a label for the y-axis (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag that controls whether or not a legend is created.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A wind plot.
*
*/
public static JFreeChart createWindPlot(String title,
String xAxisLabel,
String yAxisLabel,
WindDataset dataset,
boolean legend,
boolean tooltips,
boolean urls) {
ValueAxis xAxis = new DateAxis(xAxisLabel);
ValueAxis yAxis = new NumberAxis(yAxisLabel);
yAxis.setRange(-12.0, 12.0);
WindItemRenderer renderer = new WindItemRenderer();
if (tooltips) {
renderer.setToolTipGenerator(new StandardXYToolTipGenerator());
}
if (urls) {
renderer.setURLGenerator(new StandardXYURLGenerator());
}
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例3: plotSeperate
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
private void plotSeperate(XYDataset dataset, String p)
{
NumberAxis rangeAxis1 = new NumberAxis(p);
rangeAxis1.setAutoRangeIncludesZero(false); // override default
rangeAxis1.setLowerMargin(0.40); // to leave room for volume bars
DecimalFormat format = new DecimalFormat("0");
rangeAxis1.setNumberFormatOverride(format);
final ValueAxis timeAxis = new DateAxis("Date");
timeAxis.setLowerMargin(0.02); // reduce the default margins
timeAxis.setUpperMargin(0.02);
XYPlot plot = new XYPlot(dataset, timeAxis, rangeAxis1, null);
XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
renderer1.setBaseToolTipGenerator(
new StandardXYToolTipGenerator(
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00#")
)
);
plot.setRenderer(0, renderer1);
final CombinedDomainXYPlot cplot1 = (CombinedDomainXYPlot)this.candlestickChart.getPlot();
if (plot != null) cplot1.add(plot, 1); // weight is 1.
}
示例4: createXYLineChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a line chart (based on an {@link XYDataset}) with default
* settings.
*
* @param title the chart title (<code>null</code> permitted).
* @param xAxisLabel a label for the X-axis (<code>null</code> permitted).
* @param yAxisLabel a label for the Y-axis (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param orientation the plot orientation (horizontal or vertical)
* (<code>null</code> NOT permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return The chart.
*/
public static JFreeChart createXYLineChart(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {
ParamChecks.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
plot.setOrientation(orientation);
if (tooltips) {
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
}
if (urls) {
renderer.setURLGenerator(new StandardXYURLGenerator());
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例5: createWindPlot
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a wind plot with default settings.
*
* @param title the chart title (<code>null</code> permitted).
* @param xAxisLabel a label for the x-axis (<code>null</code> permitted).
* @param yAxisLabel a label for the y-axis (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag that controls whether or not a legend is created.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A wind plot.
*
*/
public static JFreeChart createWindPlot(String title, String xAxisLabel,
String yAxisLabel, WindDataset dataset, boolean legend,
boolean tooltips, boolean urls) {
ValueAxis xAxis = new DateAxis(xAxisLabel);
ValueAxis yAxis = new NumberAxis(yAxisLabel);
yAxis.setRange(-12.0, 12.0);
WindItemRenderer renderer = new WindItemRenderer();
if (tooltips) {
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
}
if (urls) {
renderer.setURLGenerator(new StandardXYURLGenerator());
}
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例6: createXYLineChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a line chart (based on an {@link XYDataset}) with default
* settings.
*
* @param title the chart title ({@code null} permitted).
* @param xAxisLabel a label for the X-axis ({@code null} permitted).
* @param yAxisLabel a label for the Y-axis ({@code null} permitted).
* @param dataset the dataset for the chart ({@code null} permitted).
* @param orientation the plot orientation (horizontal or vertical)
* ({@code null} NOT permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return The chart.
*/
public static JFreeChart createXYLineChart(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
plot.setOrientation(orientation);
if (tooltips) {
renderer.setDefaultToolTipGenerator(new StandardXYToolTipGenerator());
}
if (urls) {
renderer.setURLGenerator(new StandardXYURLGenerator());
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例7: createWindPlot
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a wind plot with default settings.
*
* @param title the chart title ({@code null} permitted).
* @param xAxisLabel a label for the x-axis ({@code null} permitted).
* @param yAxisLabel a label for the y-axis ({@code null} permitted).
* @param dataset the dataset for the chart ({@code null} permitted).
* @param legend a flag that controls whether or not a legend is created.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A wind plot.
*
*/
public static JFreeChart createWindPlot(String title, String xAxisLabel,
String yAxisLabel, WindDataset dataset, boolean legend,
boolean tooltips, boolean urls) {
ValueAxis xAxis = new DateAxis(xAxisLabel);
ValueAxis yAxis = new NumberAxis(yAxisLabel);
yAxis.setRange(-12.0, 12.0);
WindItemRenderer renderer = new WindItemRenderer();
if (tooltips) {
renderer.setDefaultToolTipGenerator(new StandardXYToolTipGenerator());
}
if (urls) {
renderer.setURLGenerator(new StandardXYURLGenerator());
}
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例8: createChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a sample chart.
*
* @param dataset a dataset for the chart.
* @return A sample chart.
*/
private static JFreeChart createChart( XYDataset dataset ) {
JFreeChart chart = ChartFactory.createXYLineChart(
"XYLineAndShapeRenderer Demo 1",
"X",
"Y",
dataset,
PlotOrientation.VERTICAL,
true,
true,
false
);
XYPlot plot = (XYPlot)chart.getPlot();
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible( 0, true );
renderer.setSeriesShapesVisible( 0, false );
renderer.setSeriesLinesVisible( 1, true );
renderer.setSeriesShapesVisible( 1, false );
renderer.setToolTipGenerator( new StandardXYToolTipGenerator() );
renderer.setDefaultEntityRadius( 6 );
plot.setRenderer( renderer );
return chart;
}
示例9: createChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a sample chart.
*
* @param dataset a dataset for the chart.
*
* @return A sample chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle,
domainLabel,
rangeLabel,
dataset,
PlotOrientation.VERTICAL,
!legendPanelOn,
true,
false
);
XYPlot plot = (XYPlot) chart.getPlot();
XYStepRenderer renderer = new XYStepRenderer();
renderer.setBaseStroke(new BasicStroke(2.0f));
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
renderer.setDefaultEntityRadius(6);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
plot.setRenderer(renderer);
setXSummary(dataset);
return chart;
}
示例10: createChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a sample chart.
*
* @param dataset the dataset for the chart.
*
* @return a sample chart.
*/
protected JFreeChart createChart(TableXYDataset dataset) {
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
!legendPanelOn, // legend
true, // tooltips
false // urls
);
XYPlot plot = (XYPlot) chart.getPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
plot.setRenderer(0, renderer);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
setXSummary(dataset);
return chart;
}
示例11: createChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a sample chart.
*
* @param dataset the dataset for the chart.
*
* @return a sample chart.
*/
protected JFreeChart createChart(TableXYDataset dataset) {
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
!legendPanelOn, // legend
true, // tooltips
false // urls
);
XYPlot plot = (XYPlot) chart.getPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
plot.setRenderer(0, renderer);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
setXSummary(dataset);
return chart;
}
示例12: createChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return a chart.
*/
protected JFreeChart createChart(TableXYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
XYPlot plot = (XYPlot) chart.getPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
plot.setRenderer(0, renderer);
return chart;
}
示例13: createLegend
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
protected JFreeChart createLegend(TableXYDataset dataset) {
// JFreeChart chart = ChartFactory.createAreaChart(
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
XYPlot plot = (XYPlot) chart.getPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
plot.setRenderer(0, renderer);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
return chart;
}
示例14: createXYBarChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
private JFreeChart createXYBarChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
{
XYDataset dataset = createXYDataset(values);
NumberAxis xAxis = new NumberAxis(reportChart.getXAxisLabel());
NumberAxis yAxis = new NumberAxis(reportChart.getYAxisLabel());
XYBarRenderer renderer = new XYBarRenderer();
renderer.setToolTipGenerator(new StandardXYToolTipGenerator());
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
plot.setOrientation(PlotOrientation.VERTICAL);
if (reportChart.getPlotOrientation() == ReportChart.HORIZONTAL)
{
plot.setOrientation(PlotOrientation.HORIZONTAL);
}
return new JFreeChart(reportChart.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
}
示例15: createTimeBarChart
import org.jfree.chart.labels.StandardXYToolTipGenerator; //導入依賴的package包/類
private JFreeChart createTimeBarChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
{
JFreeChart chart = null;
XYDataset dataset = createTimeDataset(values);
ValueAxis timeAxis = new DateAxis(reportChart.getXAxisLabel());
NumberAxis valueAxis = new NumberAxis(reportChart.getYAxisLabel());
XYItemRenderer renderer = new XYBarRenderer();
renderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
plot.setOrientation(PlotOrientation.VERTICAL);
if (reportChart.getPlotOrientation() == ReportChart.HORIZONTAL)
{
plot.setOrientation(PlotOrientation.HORIZONTAL);
}
chart = new JFreeChart(reportChart.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}