Closed MatthewKhouzam closed 4 years ago
I put up a patch that fixes the issue, but I am not sure if it is inline with the swtchart way of working. :)
@MatthewKhouzam SWTChart allows to add secondary axes. A secondary axis requires a converter, e.g. to convert from the base value Kilobyte to the secondary value Kibibyte. I'm just back from a business trip. I'll review your issue the next days.
@MatthewKhouzam I've added a demo. It shows how to use a secondary axis.
org.eclipse.swtchart.extensions.examples.charts.SecondaryAxisChart
You can place the axis either on secondary position (right) or primary position (left). The primary axis can be also set to visible = false.
Does this match your requirements?
You can simply run the demo from within Eclipse as a Java application.
Patch merged into develop.
Currently the implementation of swtchart looks to see if value -> formatted -> returned == value in order to determine if a value is a major tick (and thus shown) leads to unexpected behaviors when the formatter truncates decimals.
We use it in trace compass, and the Y axis does not display all the time for values divided by 1024 rather than 1000. The results are therefore a bit odd. See pic below
I don't have a solution to propose yet.
1- we could have an API to say : No minor ticks 2- we could have an API to state if a tick is minor 3- we could give a precision to the double compare (I like this one personally) 4- other more robust and correct solution I didn't think about yet.