InvientChartsConfig setYAxes and setXAxes takes LinkedHashSet

Thanks for this awesome plugin.

I just noticed that InvientChartsConfig setYAxes and setXAxes takes LinkedHashSet in stead of a Collection
for no reason that I can see. That means I have to new LinkedHashSet(myList) and then the this new set is cloned in any case.

I also noticed that this.yAxes.clear() is also not called in setYAxes (so it has more of an addYAxes effect).

Thanks for your comments.

LinkedHashSet is used to ensure that the axis are in the order they are added because each axis is assigned an index and this index is used in case of multi-axes charts.

The methods setXAxes() and setYAxes() must clear axes. That will be fixed.


You still do not need to take in a LinkedHashSet but can take in a Collection because you iterate over it and add the elements one by one, so the order will be preserved weather I give it a LinkedHashSet or a List.

cool :slight_smile:

I agree but disagree… You could also pass just HashSet, which does not maintain any order.

One last comment then I’ll stop harrassing you :slight_smile:

IMHO if the user cares about the order he should give it to you in an ordered collection (its the users responsibility) i.e. if he gives a HashSet he should not be surprised that the order jumps around.
Internally yes we always care about the order which may not be the order a naive user gives us. I think a javadoc comment should suffice.

Healthy discussions are always good. We will consider your point.