John
John

Reputation: 1596

JFreeChart how to draw ordered lines

I am currently using JFreeChart scatter graph to display a number of points. When I use the scatter graph to draw lines it draws them in the wrong order for example: the ordered list (2,3),(2,5),(3,4) is the desired order to be printed. JFreeChart takes this and draws the line in this order (2,5),(2,3),(3,4). Is there an alternative chart type I could use that could display this differently or is there a way I can override their default ordering system? Thanks.

Upvotes: 2

Views: 582

Answers (2)

Eric Mariacher
Eric Mariacher

Reputation: 349

create XYSeries with autoSort flag set to false

Upvotes: 0

trashgod
trashgod

Reputation: 205875

An XYSeries is typically used to create a scatter plot's data set. It includes constructors that exert control over the sorting. There's a related example here.

Upvotes: 1

Related Questions