1

I'm creating a TimeSeries chart with 2 TimeSerieses in it (i.e. A Dataset holding 2 TimeSeries objects.

It happens that both TimeSeries objects holds the same exact values and they are simply overlapping but that's not clear to the client as he only sees the result color or mixing the colors of both TimeSeries objects !

So he's seeing that the chart is displaying 2 sets of data, while only one line is drawn !

Is their a build-in way to deal with that ? How would you fix that ?

Personally I'm thinking of splitting this chart into 2 for it to be clear to the customer but I'm wondering if there is a way with less effort\more efficient to solve this situation.

EDIT: Final output should be images so this isn't a desktop application (i.e. Swing)

Thank you.

Muhammad Gelbana
  • 3,890
  • 3
  • 43
  • 81

1 Answers1

1

One approach is to let the user control series visibility using a suitable Action, a shown in this example.

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thank you. Is there a way to detect the overlap automatically ? – Muhammad Gelbana Mar 09 '13 at 03:05
  • @MuhammadGelbana: You could traverse the series in pairs looking for values differing by suitable some _epsilon_. Also consider `ChartPanel#setMouseWheelEnabled(true)`. – trashgod Mar 09 '13 at 04:28
  • Well I'm outputting images so there is not interaction with the client. Thank you. – Muhammad Gelbana Mar 09 '13 at 12:23
  • Do you mean like a PDF? I guess you could put each series in its own subplot of a combined plot. – trashgod Mar 09 '13 at 12:30
  • No it's on a webpage actually but I guess it doesn't differ much if it's an image exported to a PDF or through web. By `subplot` I understand you are referring to the example you pointed at through a link in your example, or is it something else ? – Muhammad Gelbana Mar 09 '13 at 12:47
  • Yes. On a web page, you can have limited interactivity by passing the state of an HTML checkbox as a parameter to your chart servlet. Sorry, I don't have an example. – trashgod Mar 09 '13 at 13:14