jfreechart

JFreeCharts Legend Text and Color Box Don't align

纵然是瞬间 提交于 2019-12-11 11:11:18
问题 I'm using JFreeCharts and creating a stacked bar graph. I have created a legend, but when I change the font for the legend to something like Calibri size 9, the text is not vertically aligned with the colored boxes. The legend appears as follows: The text is not vertically aligned with the boxes, It's like there is padding underneath or something. The following is my code for the customization of the chart public JFreeChart createStackedChart(final CategoryDataset categorydataset, String

How to remove the background's pattern?

删除回忆录丶 提交于 2019-12-11 11:08:36
问题 I'm sorry I don't know what it is so I may have asked an unclear question but I hope the attached images explains it. I circled the areas I need to remove. I simply need the whole background to have one continuous color whether it's gray or anything else. Here is the piece of code I use to generate the chart: final JFreeChart chart = ChartFactory.createTimeSeriesChart(generateTitle(title, resultsCount), xAxis, yAxis, (XYDataset) paramCategoryDataset, true, false, false); final XYPlot plot =

How to remove gaps between a time period of JFreeChart

我怕爱的太早我们不能终老 提交于 2019-12-11 10:55:25
问题 I was wondering how to remove times e.g. (5pm to 9am) from a time series in JFreeChart . I have tried this: SegmentedTimeline baseTimeLine = new SegmentedTimeline( SegmentedTimeline.DAY_SEGMENT_SIZE,24,1); However, I don't think this is what is needed to remove time periods. 回答1: SegmentedTimeline.newFifteenMinuteTimeline(), seen here, is a good example from which to start. In this example, newWorkdayTimeline() creates a new SegmentedTimeline that includes 8 hours and excludes 16 hours. It

How to call Jframe into main Jfram

和自甴很熟 提交于 2019-12-11 10:48:37
问题 I have working on stock market project. I want to make desktop app which shows stock markets chart and news. I have made so far a main frame (class) which has RSS and the second is applcationframe which shows candle stick chart (2 class). I would like to place the chart into my main frame. How can place it into my main frame/ (or how can I call application frame into frame). I will truly appreciate all advices. Here is the code for main frame: import java.awt.BorderLayout; public class Boeing

how to do partition of existing jfree pie Chart section on same chart

橙三吉。 提交于 2019-12-11 10:25:19
问题 I am using Jfreechart to create a pie chart in Spring MVC. MY requirement is: i have to create two section,FOUND and LOST on pie chart.also in,LOST section i need to create more sections representing Count of different LOST items. here right now,i am able to create two sections on chart,FOUND and LOST. but i am not getting how to do partition of LOST section on same chart. How can i achieve this..please help 回答1: You may have started with org.jfree.chart.demo.PieChartDemo1, as the source is

How to omit fraction in seconds at JFreeChart?

余生长醉 提交于 2019-12-11 09:27:29
问题 Friends, Atlast i just generate JFreeChart for the collected value from the database. But on that, i just use Second sec = new Second(); Series.add(sec.previous(), ExistingValue); Series.add(sec, Value); Dataset = new TimeSeriesCollection(Series); But it displayed result contains additional fractional point. And it just incremented with 0.250 seconds. Actually i want seconds only incremented with 1. How can i get it? And Is there any way to start Y angle chart from given value other than 0?

Dynamically setting width and height according to client screen resolution in jFreeChart.createBufferedImage(width,Height,info)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 09:26:27
问题 I have a problem regarding JfreeChart.createBufferedImage(width,Height,info) i am creating a jFreechart in java and showing it in JSF page like this JfreeChart.createBufferedImage(width,Height,info) Right now i am passing width and height as hardcoded attributes but i want the width and height should dynamically set accoding the cleint screen resolution in JSF page. Is there any way around to do it ? 回答1: There isn't a straight forward way. If you aren't familiar with the JSF lifecycle I

How to update dataset in JFreeChart Bar Chart

旧街凉风 提交于 2019-12-11 09:13:11
问题 I have got a JFrame, within this frame there is a JPanel, in a JPanel there is a JFreeChart (chart takes dataset from a method) and this chart is added to ChartPanel created in JPanel, then ChartPanel is added to JPanel. Also I have got JComboBox in JPanel, if I change option in that JComboBox an ActionListener updates value of dataset. Also method which return dataset, takes a string from JComboBox(data of dataset depends on JComboBox output). So if I change option in JComboBox I would want

How can i store image in my project hosted in openshift?

戏子无情 提交于 2019-12-11 08:56:45
问题 i am trying to create chart and save chart in image folder. it works fine locally but when i hosted it in openshift online it doesn't work. String root = getServletContext().getRealPath("/"); File savedFile = new File(root+"\\images\\piechart.jpg"); ChartUtilities.saveChartAsJPEG(savedFile, piechart, 700, 400); root gives null so saving is not working ... please help to store image. 回答1: Instead of saving the chart as an image in a local folder, you can use one of the variations of

Change colour & line width of an Annotation in JFreeChart

假如想象 提交于 2019-12-11 07:55:23
问题 I am adding an annotation to my plot, but I can't work out how to change the colour or line width (stroke) of this. I've read through the documentation as best as I can but I'm out of ideas. Can anyone help? Shape shape = new Ellipse2D.Double(circleXValue - radius, circleYValue - radius, radius + radius, radius + radius); XYShapeAnnotation annotation = new XYShapeAnnotation(shape); // ?? plot.addAnnotation(annotation); 回答1: You're using this constructor: public XYShapeAnnotation(java.awt