jfreechart

How to render JFreeChart in Play framework

谁说我不能喝 提交于 2019-12-08 23:09:25
Problem: does not allow me to renderBinary . The method renderBinary(InputStream) in the type Controller is not applicable for the arguments ( JFreeChart ). I have this controller: public static void index() { // create a dataset...Default DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("Category 1", 43.2); dataset.setValue("Category 2", 27.9); dataset.setValue("Category 3", 79.5); // create a chart... JFreeChart chart = ChartFactory.createPieChart( "Sample", dataset, true, true, false ); List<User> usersA = Department.getUsersA(); List<User> usersB = Department.getUsersB

JFreeChart : obtain data source value on mouse click

ぃ、小莉子 提交于 2019-12-08 17:36:29
问题 I have a JFreeChart instance that displays process memory status, initialized as follows: m_data = new TimeSeriesCollection(); TimeSeries vmsize = new TimeSeries("VMSize"); TimeSeries resident = new TimeSeries("Resisdent"); TimeSeries shared = new TimeSeries("Shared memory"); TimeSeries code = new TimeSeries("Code"); TimeSeries data = new TimeSeries("Data"); m_data.addSeries(vmsize); m_data.addSeries(resident); m_data.addSeries(shared); m_data.addSeries(code); m_data.addSeries(data);

How to add ChartPanel in JPanel inside a JFrame

一曲冷凌霜 提交于 2019-12-08 13:11:48
问题 I have been trying to do this.. JFreeChart chart = createChart(createDataset()); jPanel1 = new ChartPanel(chart, false); this JPanel1 is inside a JFrame ( its a JFrame Form of Netbeans, so i have some labels and textAreas) jPanel1 is fixed inside designer of Netbeans .. at some place after doing other work of data now i want a chart of my data under all the text about data.. I tried other solutions like casting the JFreeChart to jPanel. also JFreeChart chart = createChart(createDataset());

jfreechart & itext for adding many number of barcharts

只谈情不闲聊 提交于 2019-12-08 12:02:07
问题 hello can any one help me in adding many number of bar charts to a single pdf. i have a code taken from d website to create a bar chart and save it in pdf. but couldn't save multiple bar charts to a single pdf. import com.itextpdf.awt.DefaultFontMapper; import com.itextpdf.text.Document; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfTemplate; import com.itextpdf.text.pdf.PdfWriter; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.io

Built class to create a JFreeChart, how do I add it to a JPanel in my main interface?

非 Y 不嫁゛ 提交于 2019-12-08 10:26:39
问题 Have just come across JFreeChart and am trying it out for my project... I created a class, called "CountryVsCountryChart", that I want to use to create a new chart, according to the options parsed through. What I want to know is how can I add an object of this class to a JPanel in my main interface? I want to be able to do this via selecting an option in a JComboBox, but I think I would be able to handle that... Here is the the code for the class (minus the appropriate import statements)

How to count the number of series of a bar chart in JFreeChart?

谁都会走 提交于 2019-12-08 08:50:48
问题 I am facing the some problems when creating bar chart using JFreeChart . I have to write a condition according to a number of series available on the bar chart, but I don't know how to get it. 回答1: Bar charts typically use a CategoryDataset, all of which implement the KeyedValues2D interface. Use dataset.getRowCount() to get the number of series. Use dataset.getColumnCount() to get the number of distinct categories. Their product is the total number of bars. As a concrete example, I added a

generated jasper report is not showing bar chart

烈酒焚心 提交于 2019-12-08 08:46:51
问题 I have a report controller having code: @Controller public class ReportsController { @RequestMapping(value="report.htm",method=RequestMethod.GET) public String showReport() throws JRException{ ... InputStream reportStream = this.getClass().getResourceAsStream("/report.jrxml"); JRDataSource dataSource = new JRBeanCollectionDataSource(reportData); HashMap params = new HashMap(); params.put("Title", "Report"); JasperDesign jd = JRXmlLoader.load(reportStream); JasperReport jr =

Jfreechart - can we set a shape for a datapoint in StackedAreaChart?

时间秒杀一切 提交于 2019-12-08 08:14:31
问题 I am using Jfreechart to make a stacked area chart. I am using the class StackedXYAreaChart. I wanted to know if we could draw shapes at data points for the StackedAreaChart, (it a line chart we can denote each data point by setting the SetSeriesShapes()). The method setSeriesShape() doesn't seem to work. Anyone have any idea ? Here's what I have tried till now (Please do not comment that I have an empty dataset. I am plotting a dynamic graph and the series would be filled later ):

JFreeChart Boxplot Outlier and Farout appearance

被刻印的时光 ゝ 提交于 2019-12-08 07:44:54
问题 I am using JFreeChart with Java to evaluate experimental results using the boxplot chart. I want to change the color and shape of the outliers and the farout entries. This is how my plots currently look like when I use the normal BoxAndWhiskerRenderer: I set up the renderer like this: BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(true); renderer.setSeriesPaint(0, Color.DARK_GRAY); renderer.setSeriesPaint(1, Color.LIGHT_GRAY); renderer.setSeriesOutlinePaint

JFreeChart gap between legend labels

安稳与你 提交于 2019-12-08 06:30:06
问题 I've been using JFreeChart in order to plot some series but I have a doubt related to the space between the labels in the legend. Does anyone know how to set a space between legends? For example, right now: and this is how I want it to look like I'll appreciate your help. 回答1: Just go to the place in your code where the legend items are set, and change "2012" to "2012 " . 回答2: You can use the setItemLabelPadding() method in the LegendTitle class. LegendTitle legend = chart.getLegend(); legend