jfreechart

Printing with JRViewer report with jasper report which contain a chart 5.5.0

假如想象 提交于 2019-12-02 09:41:07
问题 When I create a report using JasperReports without chart form Java application and I call it from jbutton I get my report on JRViewer, its mean that my application generate the report when i didn't put any chart in this report but once i modify this report and i add charts the programm generate the following error: org.jfree.chart.axis.NumberTickUnitSource cannot be cast to org.jfree.chart.axis.TickUnits I tired to search how to solve this problem but i didn't find nothing on NET 回答1: solved

Change the starting value of value axis in Bar chart with Jfreechart

谁说我不能喝 提交于 2019-12-02 09:37:46
问题 I have the following values to be shown in a BAR chart in my Java web application. 9.46373791E8 9.45942547E8 9.45559945E8 9.45187023E8 9.44856693E8 9.44417826E8 9.44007878E8 As u can see the values are really close and have minor differences. When i generate a bar chart using Jfreechart, all the bars appear almost the same height and there is no way of telling the difference visually. So i want to change the (0,0) to (0,9)so that x axis is at number 9 on y axis. I still want to show the real

Create a marker / crosshair in a CombinedDomainXYPlot

若如初见. 提交于 2019-12-02 08:36:33
问题 I want to show in a CombinedDomainXYPlot a marker. This is not working. I can add the marker for each subplot. But I want to add it for the CombinedDomainXYPlot. Anybody who can tell me something about this issue. I think with the crosshair the behaviour is the same. This is working example which creates a CombinedDomainXYPlot and tries to add a marker. The marker adding is in createCombinedChart() import java.awt.Font; import javax.swing.JPanel; import org.jfree.chart.ChartPanel; import org

JFreeChart with truncated data points

自闭症网瘾萝莉.ら 提交于 2019-12-02 08:32:16
I have created a JFreeChart with the code below, but the Y-Axis marks are truncated. How should I display the chart even though the data points are overlapped in the Y-Axis? Basically, I want the Y-Axis points to be generated from my file, a proper range is populated and displayed in the chart. private static JFreeChart buildChart(TimeSeriesCollection dataset, String title, boolean endPoints) throws IOException { // Create the chart JFreeChart chart0 = ChartFactory.createTimeSeriesChart( title, "Hour", "Count", dataset, true, true, false); // Setup the appearance of the chart chart0

jfreechart: Gantt Chart Task Label Font Size

穿精又带淫゛_ 提交于 2019-12-02 08:30:58
I put my Gantt Chart (ChartPanel) in a JScrollPane,and create a button named [zoom in]. The function for the button [zoom in] is: When I click [zoom in] button, the width of chart panel will be doubled. newSize = originalChartWidth * 2; chartPanel.setPreferredSize(new java.awt.Dimension(newSize, 1000)); After click [zoom in] button, the scroll bar of JScrollPane will be appeared. Then the user can scroll to watch the whole chart after zoom in. But there is a problem, When I double the chart panel width, The Task Label Font will be enlarged too. Before zoom in After zoom in (The font will be

JFreechart filling sectors series

落花浮王杯 提交于 2019-12-02 08:28:41
问题 I am trying to create a filled series over each region of a polar plot. But the colors are not filled out right. Here is an image of what I get: http://i1122.photobucket.com/albums/l539/jpo2/polar-1.gif Here is the code I have to loop through a given section is as follows: if (i < 8) { for(int r = 0; r< 20; r+=(NumberAxis) plot.getAxis()).getTickUnit().getSize()){ for(int theta = 0; theta <= 180; theta+=30){ XYSeries series = new XYSeries(i + "π/8 " + "< θ < 2π+" + i + "π/8"); for (int e =

Where is DateTickUnit documentation?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 08:18:51
问题 I need to change the default DateTickUnit settings for different zoom levels for a TimeseriesChart, but can´t find the place i need to read in the documentation? I would greatly appreciate a pointer. 回答1: Here is the Java API for TimeSeriesChartDemo1: http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/demo/TimeSeriesChartDemo1.html The zoom levels documentation will be found in one of the inherited methods. I would recommend finding the exact component that requires the zoom to be

IllegalStateException: PWC3990: getWriter() has already been called for this response

那年仲夏 提交于 2019-12-02 08:01:34
java.lang.IllegalStateException: PWC3990: getWriter() has already been called for this response How to solve this error? I run a simple servlet code to display the bar graph. You cannot call both getOutputStream() and getWriter() on the same response. Keep in mind that JSP implicitly uses getWriter() . An Illusion Also make sure that the request is not being redirected to current servlet from some place else. If it is, then there is a high probability that one of getOutputStream() or getWriter() has already been called on it. 来源: https://stackoverflow.com/questions/4312309

how to draw crosshair on stock barchart

余生长醉 提交于 2019-12-02 07:51:37
Hi i want to draw cross hair on this barchar .Can somone help me.I jst want the cross hair to print X and y cordinates where my mouse is pointing or clicking.I m fine even if the cross hair prints X and Y cordinates on console .here's my code import java.awt.Color; import java.awt.Dimension; import java.io.BufferedReader; import java.io.FileReader; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.StringTokenizer; import javax.swing.JPanel; import org.jfree.chart.ChartColor; import org.jfree.chart.ChartPanel;

JFreeChart: Add and sync a srollbar when zooming a chart (Eclipse plugin / SWT)

拟墨画扇 提交于 2019-12-02 07:28:09
I am using JFreeChart library to plot something in an Eclipse view and currently my code for view initialization looks as follows: @Override public void createPartControl(Composite parent) { JFreeChart chart = null; // Created via different object chart = graph.createLineChart("Test Graph", "x", "y"); ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true); frame.setRangeZoomable(false); parent.layout(true); } I wanted to add scrolling to my graph when the user zooms in, but so far all the examples that I found (in the demo package, here , and other sources) are based on Swing