Date « Development « JFreeChart Q&A





1. Dispalying Own dates in jfree chart    jfree.org

Hi All, As I m new to jfree charts I ve started using these for last one week. Now I am able to create Timeseries chart. But I want to display my own dates on jfree chart. I m not getting the solution for this.. Can u plz help me in this regard as early as possible. Thank in Advance.

2. DateTickUnit: showing dates at 00:00 otherwise time only    jfree.org

I don't believe that DateAxis supports multiple concurrent formats. In my code I have the following hack to achieve this: I subclassed DateAxis, and added the following override of refreshTicksHorizontal Code: Select all public java.util.List refreshTicksHorizontal(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge) { java.util.List list = super.refreshTicksHorizontal(g2, cursor, plotArea, dataArea, edge); ...

3. Why not show first date    jfree.org

Your setTickUnit() call specifies that ticks should be placed along the axis at 6 month intervals. The first tick label displayed is determined by looking at the lower bound of the axis, calling previousStandardDate() for the lower bound, then stepping forward from there in 6 month intervals. In your case, this will select Jan-2003 for the first tick label, then Jul-2003, ...

4. How to draw the dates exactly on sample points    jfree.org

Hi there, I try to draw a time series chart. My data is collected every week on Wensday. How can I only draw those Wensdays on DateAxis? I tried: XYPlot plot = (XYPlot) chart.getPlot(); DateAxis axis = (DateAxis)plot.getDomainAxis(); axis.setAutoRange(false); axis.setAutoTickUnitSelection(false); axis.setTickMarkPosition(DateTickMarkPosition.START); axis.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7)); SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yy"); axis.setMaximumDate(sdf.parse("11/16/05")); axis.setMinimumDate(sdf.parse("10/19/05")); However, the chart still shows "10/21/05", "10/28/05", "11/04/05", "11/11/05". How ...

7. Skipping dates    jfree.org

All, I've been trying to hack a solution to this and have given up the hacking and was wondering if anyone else has tried/knows how to skip dates for a chart. Essentially, I have a price chart for currency prices with a deadzone from Friday afternoon to Sunday afternoon. I'd like to plot a chart of the prices without showing an ...

8. sorting by date    jfree.org

I presume you are using a CategoryAxis (and CategoryPlot). The CategoryAxis displays categories in the order that you add them to the dataset. You *can* use dates for the categories, but JFreeChart won't treat them in a special way, it looks at them as simple category labels. For date-based data, you should use a DateAxis, which works with the XYPlot class. ...

9. Date / Value 0    jfree.org

Yes, thank you, I looked for DateAxis, and I found and example with TimeseriesChart, so I changed my chart. thank you (but I have now a problem with Y-axis, I would like to have only integer on this axis, but I have : 0 0.5 1 2 2.5 ... ) my code : Code: Select all chart.setBackgroundPaint(Color.white); ...





10. how to compare dates    jfree.org

Hi all, I would like to present the end user a graph with production (int) with respect to date. e.g. 1-jan-05 90 1-feb-05 44 1-mar-05 88 . . 1-jan-06 88 1-feb-06 53 1-mar-06 44 . . What is the best graph I should use in order to present the user this comparing where dates is the x axis. (The only problem ...

11. Week Date Scale    jfree.org

Hi All I have a problem with a barchar. I have data for each first day of a week. Exemple, for June04 week, I have 5436 Transactions and for June 11, I have 3543 transactions. My problems is that the dates scale is not properply divised. JFreeChart dont have a TickUnit By week and that cause me a problem. The scale ...

12. TickUnit Problem with Date    jfree.org

Hi All I have a problem about the tickUnit. My probleme is that i set tick unit seperate in 7 days for have a tick unick for a week. But my problem is that all week on each month begin the first day of the month...For exemple...The fisrt week of january begin January 1...Februrary 1, March 1... So in reality you ...

13. Problem with Date adjustments in XYAreaChart.    jfree.org

Hi, In the XYAreaChart, I am using dates along the x-axis and corresponding values along with y-axis. I want the chart to be plotted only on the x-values and y-values present in the dataset. But in the generated graph, the points plotted on x-axis are not the same as in the dataset values. The graph is adjusting itself to the input ...

16. Date and TimeZone Problem    jfree.org

You are using an XYSeries for date-based data? You can do that, but TimeSeries might be better. Note that there will be a TimeZone used to translate your dates into millisecond values, as well as a time zone used for format the DateAxis labels from millisecond values. I can't tell from the (incomplete) information you've posted, where the problem might be. ...





17. How to create multiple date ticks    jfree.org

Hi All, I am trying create multiple tick unit in my time base graph but I am not able to do, is there a way to specify multiple ticks. I am displaying time in hours in 6 hours interval and I would like to display the dates also when ever a new day starts.

18. Problem with Date in Dynamic Chart (TimeZone)    jfree.org

Hi, I have an Applet with a dynamic chart, but in the computers of the Intranet the chart date is one hour less that the real. In the computer server web the chart date is OK. I think that can be the TimeZone. How i change the timeZone of the chart?. I hope that you can help me. Note: The Server ...

19. JFreeChart 1.0.4-Release Date ?    jfree.org

20. Vertical date : how ?    jfree.org

Easy question if you know the answer ! I get a really good graph but I could not find the way to set the date vertical . Here is my code : private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createTimeSeriesChart( "Temperatura", "Data", "Gradi Centigradi()", dataset, true, true, false ); chart.setBackgroundPaint(Color.white); StandardLegend sl = (StandardLegend) chart.getLegend(); sl.setDisplaySeriesShapes(true); XYPlot plot = chart.getXYPlot(); ...

21. Limited date range    jfree.org

That 1900 limitation arose because in the early days of JFreeChart development, I was trying to match the integer representation of dates used by various spreadsheet programs (Lotus-123, MS Excel etc). I really need to fix that...it's one of the worst pieces of code in JFreeChart. Although I probably shouldn't say that, because someone will just point out something even worse... ...

22. Jfree date    jfree.org

Hi, I am working with jfree library and I have a problem: I want to make a chart in time, I have the time of the events store in a vector, but this time has been store like a java.util.date. I can not do the cast to RegularTimePeriod (for the jfree library). How I can representate this time data in a ...

23. Start - End Dates    jfree.org

Hello All, can anyone suggest, how to print the start and dates on the date axis. i have a date array of length upto 160. so, i would like to see the start date and end date..pls guide me. i did override the refreshticks() with the required set of list but still i am unable to achieve this..any idea would be ...

25. Support for Numbers & Dates as per user Locale    jfree.org

Does JFREE supports different number locales on X , Y Datasets Can I be able to show a scale of German numbers like for e.g. 10,500.50 in German number would look like 10.500,50 I wish to use the following Number formats I wish to use the following Date formats ...

29. How to include date in timestamp only when date changes    jfree.org

Hi all, I'm using JFreeChart for generating Time series charts where X axis is always time. I'm currently displaying the date as well as time in the X axis label. But this limits the number of ticks in X axis since the width is longer due to the date getting added with each label. I would like the date to be ...

30. Dotted Lines From a Date    jfree.org

Hello! I've got a Stock Timeseries report with end of day stock values for each company dealer. My problem is how to change the line style of graph when i am seeing a future date (what means a planned stock) So i would like to have a solid line until some date, and from this date i would like it to ...

31. Histogramm with Dates    jfree.org

Hi, I want to show changes in a stock with Jfreechart. I have the date of a goods input and the date of the outward. The idea is to create a chart that shows the input grouped weekly/monthly. For each good I have the exakt date. I want to have a chart with bars. So the idea was to create a ...

32. Align DateTicks to a specific date    jfree.org

Hi, I have a chart that could be displayed in various time lengths (e.g. 1 day, 1 week, 1 month etc). I'm using Code: Select all switch((int)(length / 3600)) //length in hours { case 1: return new DateTickUnit(DateTickUnit.MINUTE, 15); ...

33. Crosshairs and Dates    jfree.org

Hi, I have a nice timeseries graph with values along the domain axis of dates of 30 days. I was trying to figure out a way to place a crosshair on today's date on the axis. Can't get it to work. This is what I have: final Range range = axis.getRange(); final double c = axis.getLowerBound() +????? * range.getLength(); No idea ...

35. How to get java.util.date from TimeSeriesDataItem?    jfree.org

It depends on your dataset. At the very least, you can rely on the methods in the XYDataset interface (e.g. getXValue() will return the number of milliseconds since 1-Jan-1970). But if you know the actual implementing class, you can very often get to the underlying data items, which might save you from recreating the Date objects.

36. Fixed dates    jfree.org

First, sorry my english. I'm studying a little bit. Please, emend me if i was wrong. Thus, I learn anymore and I'll be beholden. Well, let's see what interest. I'm using the createTimeSeriesChart method to create the chart. I have three questions about this: This is one of them. Each one is in a topic. #1 - For example, these are ...

37. TimeSeriesDemo8 and zooming. How to show the "date ran    jfree.org

TimeSeriesDemo8.java is a perfect example of this... If you zoom in to say "March" you see the various days of "March". All is good so far... Keep zooming in until you get down to the hours and you no longer can see what day the data is for. I would like to show the "date(s)" for the data in the zoomed ...

38. OHLC dates always renders in the middle of the year    jfree.org

I have created a chart where I want one OHLC set each year.. but my graphs always renders in the middle of 2 years like it is in june.. This is what i have Year temp = new Year(2001); OHLCSeries s2 = new MyOHLCSeries("test"); s2.add(new Year(new Date(temp.getFirstMillisecond())), 10, 10, 2, 2); This renders right between 2001 and 2002.. why is that? ...

39. Map Plot-crossing the date line    jfree.org

I'm trying to write an application that displays data superimposed upon an image of the earth. Mostly, it's working, except in cases where the data set in question crosses the international date line. The problem is, I'm supposed to represent all longitude points as having values between -180 and 180. When something crosses the date line, the relevant longitude points begin ...

40. Specifying dates and times on charts    jfree.org

Hi, I am trying to create a chart, with several series (let's say revenue from different products) against time, as lines. The time intervals I have are Dates coming from a database, each representing a week (the Monday). I need these specific dates to appear on my chart (horizontal axis). However, I am unclear about what sort of chart to use ...

41. Problem: Date Reprensentation of Status changes    jfree.org

Problem: Date Reprensentation of Status changes by chrissalo Fri Sep 19, 2008 1:59 pm Hello! I would like to generate a chart about the history of a status of files in our development environemnt. I would like to represent it in a correct timetable. Example: Following stati are possible: new, open, working, test, closed, reopen, postponed I have two different ...

42. set date to x-label    jfree.org

Hello, I have a question concerning the x-label of a xy- line chart, At my x-axis I show the time and at the y- axis the value, So when I will show only a few hours I can see the time but I can't see the date on the x- axis (I see 13:20 but I will see 13:20 17. Nov. ...

43. Date is not displayed completely    jfree.org

Hi All, I was trying to create a Bar chart with X-Axis as Date and Y-Axis as count. Here when I set the DateFormat as MM/DD/YYYY HH:MM:SS, the chart does not display the entire date. Is there a way to display the entire date either by changing the orientation or by setting a toolTip to the Date .. so that it ...

44. Bad date in my createTimeSeriesChart    jfree.org

Hi I use createTimeSeriesChart to display my chart. I use TimeSeries like that TimeSeries s_other_cpu_time = new TimeSeries("Other Cpu Time", Minute.class) whith TimeSeriesCollection like that TimeSeriesCollection dataset1 = new TimeSeriesCollection(s_other_cpu_time); I add date like that s_other_cpu_time.add(new Minute( str_date ), data); str_date is a string which represente a date with this format "yyyy-mm-dd HH:mm:ss" My probleme is that dates I insert is ...

45. Controling Dates on My ClusteredXYBar Chart    jfree.org

You'd have to subclass the DateAxis and override the refreshTicks() method. I have some ideas about improving this area of the DateAxis code, but it involves quite a lot of change (because there are several inter-related features that I want to implement) so I don't know when that will make it into the release.

47. How to read date from XML    jfree.org

Custom Solution I used; New class CustomDatasetReader: Code: Select all public class CustomDatasetReader extends DatasetReader { public static XYDataset readXYDatasetFromXML(InputStream in) throws IOException { XYDataset result = null; SAXParserFactory factory = SAXParserFactory.newInstance(); try { ...

48. Date format input for charting    jfree.org

I need help with time and jfreechart. I have an sql 20008 db with a datetime2 datatype. The format is: "2009-05-28 14:25:36.7530000" through CF. Right now I use the default cateogrydataset and it works ok. However I would like use another type such as xy or timeseries. Can jfreechart handle this type of date input? Is there something I should do ...

49. Programmatic Zoom In Given Specified Date    jfree.org

Given following image I would like to programmatic zoom in to say, from 2007 - 2008 Here is what I plan to do : (1) Programmatic completely zoom out. - zoomOutBoth(double x, double y) - but what x, y value I shall pass in? (2) final double d_2007_screen_coordinate = domainAxis.valueToJava2D(2007_time_stamp_value, plotArea, domainAxisEdge); (3) final double d_2008_screen_coordinate = domainAxis.valueToJava2D(2008_time_stamp_value, plotArea, domainAxisEdge); (4) ...

50. grid lines on excluded dates using segmented timeline    jfree.org

if (!isHiddenValue(tickDate.getTime())) { ... } else { tickDate = unit.rollDate(tickDate, ...

51. JFreeChart - Date representation    forums.oracle.com

Hi All, I am using JFreeChart in my project. In my application I created the Bar chart, X Axis with date and Y Axis with some integers. Date displayed in the X Axis is in the MM-DD-YYYY hh:mm format.But it is not displayed consistently. ie it should be displayed in vertical format so it occupies lot of places.It should display in ...