/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. */ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Buckets (sec)", false, "Count", dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingPanel = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingPanel,chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. */ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Elapsed Time (sec)", false, "Time" + unitSuffix(), dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingTable = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingTable, chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
renderer.setToolTipGenerator(new StandardXYToolTipGenerator("{0} {2} " + tooltip, NumberFormat.getNumberInstance(), NumberFormat.getNumberInstance()));
new StandardXYToolTipGenerator( chartDefinition.getTooltipContent(), new SimpleDateFormat( chartDefinition .getTooltipXFormat() ), new DecimalFormat( chartDefinition.getTooltipYFormat() ) ); renderer.setToolTipGenerator( generator );
renderer.setToolTipGenerator(new StandardXYToolTipGenerator("{0} {2} " + i18nBean.getText("portlet.createdvsresolved.tooltip.issues"), NumberFormat.getNumberInstance(), NumberFormat.getNumberInstance())); final VelocityRequestContext velocityRequestContext = new DefaultVelocityRequestContextFactory(applicationProperties).getJiraVelocityRequestContext(); XYURLGenerator xyurlGenerator = new XYURLGenerator()
new StandardXYToolTipGenerator( chartDefinition.getTooltipContent(), new SimpleDateFormat( chartDefinition .getTooltipXFormat() ), new DecimalFormat( chartDefinition.getTooltipYFormat() ) ); renderer.setToolTipGenerator( generator );