jfreechart

JFreeChart X axis labels are going out of chart area

て烟熏妆下的殇ゞ 提交于 2020-01-04 06:40:09
问题 I have a JFreeChart chart with DateAxis as domain. It looks very nice, however the last axis label sometimes goes out of the chart area. Here is the sample code to reproduce: public class LineChart_AWT extends ApplicationFrame { public LineChart_AWT( String applicationTitle , String chartTitle ) { super(applicationTitle); ValueAxis timeAxis = new DateAxis(""); NumberAxis valueAxis = new NumberAxis("Number"); ((DateAxis)timeAxis).setDateFormatOverride(new SimpleDateFormat("YYYY-MM-dd HH:mm"));

How to set Locale to labels in Bar Chart?

假如想象 提交于 2020-01-04 05:50:10
问题 I am displaying a bar chart and trying to have the labels above bars displayed in correct locale (they are floats). I am developing in JasperSoft Studio 6.2.0. I set the global and/or the report (execution-time) locale to en_US , but the labels are still displayed in my Windows locale ( nl_NL ). I then set the label expression to new DecimalFormat("#,##0.0##;(#,##0.0##-)").format($F{Hours}) but it's still in Windows locale. Only when I explicitly set the label expression to en_US locale:

How can I transfer dots to line in JFreeChart?

我怕爱的太早我们不能终老 提交于 2020-01-03 20:00:04
问题 I am having a problem converting dots, which is generated by JFreeChart, into a line. First of all, there some source that really helped me reach this point Adding points to XYSeries dynamically with JfreeChart JFreechart candlestick chart weird behaviour on drag http://www.java2s.com/Code/Java/Chart/JFreeChartXYLineAndShapeRendererDemo.htm Secondly , this is my code import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt

Jfreechart get Mouse Co-ordinates

安稳与你 提交于 2020-01-03 17:10:03
问题 I have been trying to get current Mouse Co-ordinates in a JfreeChart and found that the following solution was working partially JFreeChart get mouse coordinates I have been using OHLC Dataset to draw the chart and while I could get the RangeAxis properly (meaning in the subplot values), I couldn't make anything out of the value recieved for the X-Axis from the above example. I am sure that I am receiving the values in some other format (not the displayed date format), anyone could point out

jfreechart setbackgroundpaint not doing anything

久未见 提交于 2020-01-03 08:57:25
问题 To anyone who has experience with jFreeChart for Swing applications: I am having trouble changing the background for charts. My ultimate goal is to set a smooth gradient background for my charts, but I am unable to change any backgrounds at all. This line of code chart.setBackgroundPaint(Color.BLUE); should do something , am I right? But it doesn't change anything. All I get is the same grey plot background and white chart background. I'm scratching my head as to why I can't get the colors to

Auto-Scale Y-Axis in JfreeChart

廉价感情. 提交于 2020-01-03 08:43:22
问题 I am using JFreeChart to create candlestick charts in my Java app. However, my charts end up looking like this: http://imageshack.us/photo/my-images/69/capturebhx.png/ I would like to have the Y-axis automatically scaled so that the chart looks more like this: http://imageshack.us/photo/my-images/717/capture2wl.png/ I think org.jfree.chart.axis.NumberAxis.configure() will do this, but I'm not sure. I can't seem to find a way to tie my JFreeChart object, or ChartPanel object to this NumberAxis

Auto-Scale Y-Axis in JfreeChart

大城市里の小女人 提交于 2020-01-03 08:41:18
问题 I am using JFreeChart to create candlestick charts in my Java app. However, my charts end up looking like this: http://imageshack.us/photo/my-images/69/capturebhx.png/ I would like to have the Y-axis automatically scaled so that the chart looks more like this: http://imageshack.us/photo/my-images/717/capture2wl.png/ I think org.jfree.chart.axis.NumberAxis.configure() will do this, but I'm not sure. I can't seem to find a way to tie my JFreeChart object, or ChartPanel object to this NumberAxis

Java JFrame Window not appearing when run from Eclipse

为君一笑 提交于 2020-01-03 07:20:09
问题 A very simple problem. I try to run a very simple demo to created and display a Window Frame from Eclipse, and nothing happens. No errors, no window, the code runs to completion. I added breakpoints and made sure the code runs as expected. The code is straight from Java tutorials (FrameDemo), I just renamed the package to fit where I placed it (other code from this package runs fine): package ui; import java.awt.*; import javax.swing.*; /* FrameDemo.java requires no other files. */ public

How can I add a horizontal scroll bar in JFreeChart?

时光毁灭记忆、已成空白 提交于 2020-01-03 05:33:33
问题 Can I include a horizontal scroll bar to view the previous data in a JFreechart ? I am using linechart graph to draw dynamic graph and showing 10 values on x-axis at a time, I want to view the graph with a horizontal scroll bar. How can I set the values for scrollbar to view the previous data? 回答1: Several options are available: Adding your ChartPanel to a JScrollPane , Using a SlidingXYDataset, mentioned here, Using a paging approach, illustrated here. Addendum: Using a

How to render JFreeChart in Play framework

有些话、适合烂在心里 提交于 2020-01-03 03:55:27
问题 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,