Date and String combination XY chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
praveen4557
Posts: 3
Joined: Thu Nov 03, 2016 7:37 am
antibot: No, of course not.

Date and String combination XY chart

Post by praveen4557 » Thu Nov 03, 2016 7:47 am

Hello JFreeChart team,

Currently I am using JFreeChart to creating dynamic charts, I am new to JFreeChart. I am facing problem with combination of DATE & STRING XY chart. Because most of the Dataset's having combination with Number or Double value. But my requirement I need to maintain Y axis with Fixed string label names and same time X axis with dynamic date time values from database. For this, I have tried with TimeSeries, but TimeSeries combination with RegularTimePeriod & double value only..but my case I need String label on Y axis. When I use Symbolaxis to make it Y axis as String label names, it was showing successfully. But date points not showing in Chart. Please help me on this. Since 3 weeks stucked with this issue.

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Date and String combination XY chart

Post by John Matthews » Thu Nov 03, 2016 11:31 pm

Cross-posted here.

praveen4557
Posts: 3
Joined: Thu Nov 03, 2016 7:37 am
antibot: No, of course not.

Re: Date and String combination XY chart

Post by praveen4557 » Fri Nov 04, 2016 3:30 am

Hi John Matthews,

But I could not understand and got the solution from them.That's why I have post here. Please help me with any suggestions.

Thanks

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Date and String combination XY chart

Post by paradoxoff » Fri Nov 04, 2016 6:09 pm

You could have at least posted a link to the SO thread. Please do that the next time.
I am confused by the picture in the SO thread and by your explanation.
Initially, I had thought that you are getting date values from the database and want to use a single date value to calculate both the x and y coordinate of a point, with the y value being the month only (neglecting the year) and the x value being the complete timestamp (month and year and maybe the day, but the latter is impossible to tell from the picture).
But then I noted that the order of the data points is not in agreement with that assumption. In the 2014 section, the light green point is the leftmost position among the 4 "2014" points, but is showing in the "October" section of the y axis.
Going through the data points from left to right in the 2014 section, the data points are assigned to the following "months" on the y axis: Oct-Jan-June-Feb.
To me, it seems that the "month" value shown on the y axis has nothing to do with the x-coordinate of the data point, or the x axis is not a date axis.
Could you please explain how the y-coordinates and the x-coordinates of the points shown in the SO thread are calculated?

praveen4557
Posts: 3
Joined: Thu Nov 03, 2016 7:37 am
antibot: No, of course not.

Re: Date and String combination XY chart

Post by praveen4557 » Mon Nov 07, 2016 2:54 am

Hi paradoxoff,

Thanks very much for your reply..Seems my question was in confusion mode. I will explain in proper understanding way.

Thanks

Locked