jfreechart

Difficulty Changing background colour of JFreeChart

戏子无情 提交于 2019-12-25 06:28:08
问题 Im trying to change the background color to my bar chart and so far nothing seems to be working Here is my code below: JFreeChart expbarchart = ChartFactory.createBarChart("Monthly Expenditures", "Expenditure Type", "Amount (£)", barexp, PlotOrientation.VERTICAL, false, true, false); ChartPanel expframe = new ChartPanel(expbarchart); expframe.setLocation(695, 49); expframe.setSize(641,500); expframe.setBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(173, 216, 230), null)); graphpanel

How to switch from log 10 to log 2 in jfree [duplicate]

Deadly 提交于 2019-12-25 05:36:24
问题 This question already has answers here : Logarithmic Axis Labels/Ticks Customization (3 answers) Closed 3 years ago . I am using JFree to generate my chart. Below is the image for your reference. As visible in image current scale is based on 10 so 10,100,1000 are there in x-axis scale. Would it possible to change it to log 2. So in case of log 2 point would be visible 2,4,8,16,32, 64 and so on. Class LogarithmicAxis.java is being used for rendering x-axis. Please let me know if its possible

JFreeChart with shadow and circle nodes

别说谁变了你拦得住时间么 提交于 2019-12-25 05:33:21
问题 I created a line chart: But I want it to make it looks like this. I also don't know what kind of chart is this. I want to make also have a shadow and circle nodes in it. Just like this: How can I do this? By the way I'm displaying the chart in the webpage as PNG image format if it is relevant to my question. Thanks in advance. 回答1: For info, the sample chart you are trying to replicate is included in the JFreeChart demo collection. The complete source code for the demos is included with the

How can Implenent a Pie Chart using jFreechart in jsp? [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-25 05:25:27
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can i display pie chart in jsp page? <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page import="java.awt.*"%> <%@ page import="java.io.*"%> <%@ page import="org.jfree.chart.*"%> <%@ page import="org.jfree.chart.entity.*"%> <%@ page import="org.jfree.data.general.*"%> <% DefaultPieDataset

how does zoomRange() works?

烂漫一生 提交于 2019-12-25 04:59:09
问题 I need to zoom out from rangeAxis in jFreeChart , so I've used zoomRange for this purpose. But I didn't understand what is lowerPercent and upperPercent ? I want to set the rangeAxis as shown below in the image. How can i do that? I've tried this but don't know what should be the value of rangeAxis.zoomRange(0,?) public class Profilee { double last=0; ChartFrame frame1; JFreeChart chart; ChartUtilities cu=new ChartUtilitiesImpl(); public void generateProfile(double[] pointValue,double[]

How to show the tooltip for jfreecharts rendered as images on jsp

谁说我不能喝 提交于 2019-12-25 03:38:16
问题 I am using JFreeChart, and I am rendering the chart as an image using a servlet via JSP. I saw the tooltips while using a chart frame. How can I display tooltips on the JFreeChart image. Please help me; it's important. 回答1: In a servlet/JSP environment, the dynamic features of a chart are unavailable. For tooltips, you can achieve a similar effect using a label generator, shown here. Of course you can supply any desired request parameters to the servlet, at the expense of re-generating the

running struts+tomcat6 application in linux+openJDK error

不羁岁月 提交于 2019-12-25 03:02:33
问题 I get the following exception when trying to run my application in eclipse. Caused by: Unable to load configuration. - Class: java.net.AbstractPlainSocketImpl File: AbstractPlainSocketImpl.java Method: connect Line: 158 - java/net/AbstractPlainSocketImpl.java:158:-1 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374) at org.apache.struts2.dispatcher

Adding years to X axis on line chart using jFreePanel

允我心安 提交于 2019-12-25 01:25:16
问题 I have looked through other examples but not found one that answers this question. I'm using jFreePanel in java. I'm trying to create a line chart with the X-axis labeled marking the year change (ie: 2005, 2006, 2007, etc). The data is made up of readings taken daily, so it would not be possible to indicate each one, but breaking them down by year seems very reasonable. I'm struggling to figure out how to do it, though. So, instead of... X-axis ________________________________________________

Add a jfree bar chart into a scroll pane

烈酒焚心 提交于 2019-12-24 21:23:27
问题 I have a JFree Bar Chart. the dataset is populated using DefaultCategoryDataset , There may be situations when the values on both the domain and range axis are such that these values are not very clearly visible. I need something like a scrollPane into which the chart can be added. But it looks like the ChartPanel cannot be added into a JScrollPane Is there any way of doing this ? Thanks Bhavya 回答1: You can use setLowerMargin() and/or getUpperMargin() on the relevant CategoryAxis to improve

Image histogram generated by JFreeChart

不羁岁月 提交于 2019-12-24 17:59:11
问题 I want to display histogram of image color channels. At first my reading of pixels looks like: for(int i=0; i<width; i++) for(int j=0; j<height; j++) { data=writeableRaster.getDataElements(i, j, null); red=colorModel.getRed(data); green=colorModel.getGreen(data); blue=colorModel.getBlue(data); rgb=(red+green+blue)/3; ++redL[red]; ++greenL[green]; ++blueL[blue]; ++rgbL[rgb]; } } I also have additional method for creating chart with given channel colors table: int number = channelHistogram