-2

I am using JfreeChart to create dynamic charts. Currently, am facing a problem to create a Chart to show dynamic Date time values from database.

enter image description here

Showing above picture, I want to fix Y axis with months JAN to Dec.

Since long back trying , but I could not find any solution. Please give me the solution to fix above issue

ChrisB
  • 2,497
  • 2
  • 24
  • 43
Praveen
  • 11
  • 2

1 Answers1

1

Use a DateAxis, like they show here, and format the labels for months.

DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("MMM"));
Community
  • 1
  • 1
Catalina Island
  • 7,027
  • 2
  • 23
  • 42
  • Thanks @Catalina Island – Praveen Oct 28 '16 at 03:51
  • But, I want to fix Y axis always JAN to DEC as label names..and want to show dynamic data values on X axis. Example: Oct 3rd 2014 value getting from database..I want to show the value in chart in above image as I mentioned. – Praveen Oct 28 '16 at 03:57