jfreechart

Saving a PNG file on a server in a Java bean, using JSTL

跟風遠走 提交于 2019-11-28 02:19:53
问题 I am writing an update page in JSTL where the user inputs some numbers. I then call a java bean - passing the numbers as parameters - which, using JFreeChart, creates a PNG image. All of this works fine when I save the file directly on my hard drive using ImageIO.write(myBufferedImage, "png", new File("C:/testChart.png")); I can also save the image to my tomcat directory and view it when I am running the website on my localhost. However, once this code is up on a server that is not my local

What is the right way to create thumbnail charts?

纵然是瞬间 提交于 2019-11-28 02:16:21
I'm trying to create a chart of thumbnails of some data with using JScrollPane , but I encounter performance difficulties. This example has about 100 thumbnails charts with 5000 samples in each one. When I'm trying to scroll down and back to up multiple times, scrolling occurs with delay, CPU load increasing, application memory usage reaches over 500 Mb. Is there a way to avoid this performance problem without reducing my data? import java.awt.Color; import java.awt.EventQueue; import java.awt.GridLayout; import java.util.Random; import javax.swing.JFrame; import javax.swing.JPanel; import

JFreeChart: data disappears after zooming and panning

冷暖自知 提交于 2019-11-28 02:11:31
I have a JFreeChart time series chart, which displays a TimePeriodValuesCollection. The dataset contains two intervals. The data is appearing correctly and I am able to pan (with Ctrl-drag) the view. The problem is that if I zoom in, and I pan the view to the right in the zoomed view, the second interval suddenly disappears after the first interval is no longer visible. Everything is OK, if there is only one interval, or if I don't zoom in. Any thoughts? SSCCE: public class DisappearingTest { public static final SimpleDateFormat oracleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); public

Setting histogram breaks in JFreeChart

只愿长相守 提交于 2019-11-28 02:06:16
I am using JFreeChart to draw histograms by filling a HistogramDataset object with my data and using the ChartFactory.createHistogram(). However, So far I have not been able to find anything in the documentation on how to set the breaks of the histogram. Am I missing anything, or does JFreeChart nog offer this functionality? To illustrate what I mean with breaks, see the following two histograms generated from the same data with identical number of bins, but with different breaks. Note how the shapes of the distribution are very different between the two histograms, therefore it is important

How can I change the tickLabel on a NumberAxis in JFreeChart?

霸气de小男生 提交于 2019-11-28 02:00:33
I am using JFreeChart and want to be able to change the label on the range axis from a number to something more meaningful for the domain I am in. I only see options for customizing the look of the label and no way to override the content of the label based on the position of the tick. Does anyone know how to override the text of the tickLabel? The JFreeChart BarChartDemo1 shows how to use the setStandardTickUnits() method. NumberAxis has several handy static factories for this. To override the defaults, you can "create your own instance of TickUnits and then pass it to the

How to plot a Line Graph in Java using dataset from a text file?

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:46:39
I have written a Java GUI program which opens a text file and reads the data in the left panel. Now I want to display a graph of the data read from the same file on the right panel. I have used JFileChooser to open files and read the data and display them on a text area. I want the data read from the file to be displayed using a two dimensional X-Y graph. The axis of the graph should be labeled using the label information specified in the data file. The values on the X-axis should begin from the x-axis start value specified, with intervals which increment at a rate determined by the x-axis

JFreeChart with selectable domain axis and zoom

杀马特。学长 韩版系。学妹 提交于 2019-11-28 01:39:48
How to have chart like https://www.amcharts.com/demos/line-chart-with-scroll-and-zoom/ I am specifically interested in these functionalities To be able to select window of domain axis with those 2 selection controlls. To be able to zoom by selecting portion of domain axis. To be able to zoom out and see the bigger picture. To be able to map to range axis (Y) and see the value on that balloon like tool tip at any point (without Marker) I made initial attempt here Scrollable JFree domain axis and custom marker label with help of trashgod I made domain scrollable. I am still missing these

JFreeChart DynamicTimeSeriesCollection with a period of n milliseconds

故事扮演 提交于 2019-11-28 01:34:15
I'm trying to define an applet with a chart that have to be updated every n milliseconds. For example every 500 milliseconds. This is a part of the code: dataSet = new DynamicTimeSeriesCollection(1, 200, new Millisecond()); dataSet.setTimeBase(new Millisecond()); When I launch the application it returns me a NullPointerException raised by the second line. If I replace Milliseconds with Seconds it works. The question is: how can I set a period of n milliseconds without having exceptions? Thanks It looks like pointsInTime is not being initialized for Millisecond , but you can do so in a subclass

JFreeChart : how do you put multiple charts into a composite chart

谁说我不能喝 提交于 2019-11-28 01:21:36
In JFreeChart is there a notion of a composite Chart. I need to layout several charts in a grid like arrangement. Each chart in the grid needs to have its own separate title. I would like to be able to save this composite chart into a png file I would get a code snippet that explains how to do this. trashgod As shown here , ChartPanel can be placed in any desired Swing layout. The example cited uses GridLayout . ChartUtilities has methods for rendering a chart as a .png . I see several approaches to getting a composite image: Use Robot#createScreenCapture() to image the layout, as shown here

Update graph with JFreeChart and slider

与世无争的帅哥 提交于 2019-11-28 01:19:27
I have a time history for arrays describing the pressure along a pipe. So I have an array of pressure values along the length of the pipe for each delta t. I want to plot the pressures along the length of the pipe with JFreeChart and chose which delta t to plot with a slider, so that whenever the user moves the slider the graphic is updates with values from a different delta t. I'm also resetting the tile to be the pressure at the last portion of the pipe. What happens is that the title is updates, meaning the data is being properly updates, but the curve remains the same. I have read every