jfreechart

Insert a button into a JFreeChart graph

好久不见. 提交于 2019-12-20 03:13:11
问题 I used a code in order to display a graph. I want to insert a button in this graph (Show details) that i will used in order to present some details about the graph .It is realisable? thanks. if(jCheckBox3.isSelected()) { try { con = getConnection("jdbc:mysql://localhost:3306/base_rapport","root",""); Statement statement = con.createStatement(rs.TYPE_FORWARD_ONLY,rs.CONCUR_READ_ONLY); String sql3 = "Select Vendor, sum(Rate) as Rate from (select case Vendor when 'NSN' then 'Nokia' else Vendor

Changing custom colors in JFreeChart stacked 3D bar chart

纵然是瞬间 提交于 2019-12-20 03:11:34
问题 I have already searched enough on web but with no luck. I have created a stacked 3d bar chart wherein I am unable to change the default colors. I tried all the advices provided . Below a small snippet of my code. This is my input. My Data from Db is: A 0 2 B 15 53 C 0 2 D 0 2 E 0 1 F 1 0 G 0 1 Somehow I converted this to dataset requirement and also added items and models. CategoryDataset dataset = DatasetUtilities.createCategoryDataset(item,models, data); chart = ChartFactory

How can I include a JFreeChart servlet image in a JSP

风流意气都作罢 提交于 2019-12-20 03:09:08
问题 I have seen several examples of using a Servlet to dynamically generate a chart using JFreeChart, and subsequently including that image in a JSP using an img tag. For example: <img src="/MyChartServlet" width="400" height="300" border="0" alt="" /> My servlet which generates the image using JFreeChart works great, and I can see the image if I call it directly in the browser as in: http:/myurl/MyChartServlet?id=274 The problem is that my JSP does not display the image. In fact, the JSP is not

How can I include a JFreeChart servlet image in a JSP

百般思念 提交于 2019-12-20 03:08:21
问题 I have seen several examples of using a Servlet to dynamically generate a chart using JFreeChart, and subsequently including that image in a JSP using an img tag. For example: <img src="/MyChartServlet" width="400" height="300" border="0" alt="" /> My servlet which generates the image using JFreeChart works great, and I can see the image if I call it directly in the browser as in: http:/myurl/MyChartServlet?id=274 The problem is that my JSP does not display the image. In fact, the JSP is not

How to change color of particular sub-task in JFreeChart Gantt Chart?

筅森魡賤 提交于 2019-12-20 02:30:54
问题 I have a Gantt Chart with 5 tasks. Each task is divided into 3 sub-tasks. I need to define different color for each sub-task, e.g. Sub-task1: "light blue", Sub-task2: "blue", Sub-task3: "dark blue". I tried to google some examples, but I didn't find any full working example. Thanks. Update#1: I'm using IntervalCategoryDataset for the dataset. IntervalCategoryDataset dataset = createDataset(data); final Task t = new Task("Resource " + i, date(time11), date(time14)); t.addSubtask(new Task(

Change JFreeChart Histogram colors dynamically?

无人久伴 提交于 2019-12-20 01:37:28
问题 I'm trying to show the histogram of an image and show only some colors. I've already done that with JFreeChart and createXYLineChart and getting all the data by iterating over all pixels. To speed it up I'm trying to do it with "createHistogram". I've followed this code. To update the chart with the new values I've used this two methods: XYPlot plot = (XYPlot) chart.getPlot(); plot.setDataset(setHistogram(red, green, blue)); Being setHistogram a method which returns a HistogramDataset

how to change pie chart colors of JFreeChart?

耗尽温柔 提交于 2019-12-19 18:58:16
问题 how to customize the colors of JFreeChart graphic. lets see my java code : private StreamedContent chartImage ; public void init(){ JFreeChart jfreechart = ChartFactory.createPieChart("title", createDataset(), true, true, false); File chartFile = new File("dynamichart"); ChartUtilities.saveChartAsPNG(chartFile, jfreechart, 375, 300); chartImage = new DefaultStreamedContent(new FileInputStream( chartFile), "image/png"); } public PieDataset createDataset() { DefaultPieDataset dataset = new

how to change pie chart colors of JFreeChart?

﹥>﹥吖頭↗ 提交于 2019-12-19 18:58:06
问题 how to customize the colors of JFreeChart graphic. lets see my java code : private StreamedContent chartImage ; public void init(){ JFreeChart jfreechart = ChartFactory.createPieChart("title", createDataset(), true, true, false); File chartFile = new File("dynamichart"); ChartUtilities.saveChartAsPNG(chartFile, jfreechart, 375, 300); chartImage = new DefaultStreamedContent(new FileInputStream( chartFile), "image/png"); } public PieDataset createDataset() { DefaultPieDataset dataset = new

JFreeChart strange rendering (headless RedHat)

大憨熊 提交于 2019-12-19 12:03:37
问题 I am currently migrating an application from a windows environment to a Redhat one. This application is using JfreeChart 1.0.6. It is a web app deployed in a tomcat 7 on a Redhat headless environment running on a Open-JDK6). I obtain the following PNG. It looks like handwrited chart and everything is shifted towards the top of the image. Did someone already encounter such issue and got a fix? See my chart below : image http://img194.imageshack.us/img194/4489/graph20120801105017.png See below

Dynamic tool tip generator - Jfreechart

痴心易碎 提交于 2019-12-19 10:42:40
问题 I am generating a dynamic chart (XYLineChart) using jFreeChart and I have a field which is not included in the dataset. The field is generated dynamically. I want to include that in my tooltip. Is there any possibility I can do it ? Here is the flow of the program: Create Chart using an empty dataset. Set chartPanel. (I guess here is the place where we define the TooltipGenerator). Receive dynamic data from socket. Add data to the dataset. ( Here is the only place where I have the data which