Forums Register Login

Setting Initial Value In JFreeChart

+Pie Number of slices to send: Send
Hi,

The program is creating time chart using

In the program, take the current sysdate. Now chart should start with one hour back date form current sysdate,
And it must be of ten minutes of interval.
How to achieve this?


Thansk,
Tanzy.
+Pie Number of slices to send: Send
Lots of JFreeChart TimeSeries demos can be found at http://www.java2s.com/Code/Java/Chart/Time-Series-Chart.htm
+Pie Number of slices to send: Send
Thank you Ulf for the reply.
Well i used this for the the demonstration.

In this example, what i saw that x axis value is not fixed. Its getting changed as per value of minute given in data.
For example --

1. Use the sample program with nothing changed.
X axis --> 20:02, 20:04,20:06.......

2. commented these four value --


x axis value --> 21:01:00, 21:01:30, 21:02:00,....

And so on.
I am not getting, how to control these value?
+Pie Number of slices to send: Send
The way to alter the display of axis values is: JFreeChart.getPlot --> Plot --> cast to XYPlot --> getDomainAxis --> valueAxis --> cast to DateAxis --> setDateFormatOverride(DateFormat). Check the javadocs of those classes for details.
+Pie Number of slices to send: Send
Thank you Ulf.
I added this to above piece of code


Now the formatting is under control. But still the core problem is not fulfilled, i.e. how to start the x-axis value with one hour back time from the current time. For example if current time is 11:30 PM, the xaxis should start with 10:30 PM.
+Pie Number of slices to send: Send
That's just a matter of passing the correct data to JFC. Which values *are* you passing to it? What prevents you from passing the correct values?
Your mother was a hamster and your father was a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1855 times.
Similar Threads
Game on SQL
oracle date between
on system time.
How to find the difference of a day in Oracle
How to Inserting current Date to DataBase
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:00:08.