1

I'm using an XYPlot (ChartFactory.createXYStepChart) and the problem is the X-Axis is sample frames whose type is long, so I'm populating my XYSeries by calling xyseries.add(long, double). The result is that JFreeChart automatically interprets the x-values as Date instances, rendering them as something that looks like SMPTE time code:

enter image description here

Instead I want to show the X values as plain (integer number) sample frames. How can I tell the plot or the renderer to revert to default numeric formatting, leaving the longs as longs?

0__
  • 66,707
  • 21
  • 171
  • 266

1 Answers1

1

ChartFactory.createXYStepChart() creates a DateAxis for the xAxis, as seen here. DateAxis interprets your long values as milliseconds since the epoch; it displays them as dates. You can either

  • Create a new NumberAxis and use it in a call to the plot's setDomainAxis() method.

  • Create your own factory method that instantiates NumberAxis directly; a related example is shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045