eclipse / swtchart

Eclipse Public License 2.0
44 stars 41 forks source link

Make Axis Line optional #274

Closed MatthewKhouzam closed 2 years ago

MatthewKhouzam commented 2 years ago

I am exploring for trace compass different ways to make the data easier to read

Here is an example chart with a pair of custom charts. A style that is becoming more popular now is a minimalist chart where the Y axis bar is invisible. Example with Y Axis line: image And without image This image is an example of what I am looking for, and to get it, we just need to comment out one line. Do you have any API suggestions to make this make sense?

eselmeister commented 2 years ago

@MatthewKhouzam Am I right, you would like to disable drawing the black line of the Axis?

Bildschirmfoto von 2021-11-19 06-33-27

MatthewKhouzam commented 2 years ago

@eselmeister As usual, you are correct. It's trivial to do in the code, the API is the tricky part.

eselmeister commented 2 years ago

@MatthewKhouzam Let me inspect it. I'm pretty confident that extending the IChartSettings by an extra option will do the trick.

eselmeister commented 2 years ago

I found a solution. The code will be merged today.

eselmeister commented 2 years ago

@MatthewKhouzam Done :-)

The axis lines can be now activated/deactivated for each axis separately via the method setDrawAxisLine(...), e.g.:

IChartSettings chartSettings = scrollableChart.getChartSettings();
chartSettings.getPrimaryAxisSettingsX().setDrawAxisLine(false);
scrollableChart.applySettings(chartSettings);

Have a look at the demo chart examples: org.eclipse.swtchart.extensions.examples.charts.DemoChart

Bildschirmfoto von 2021-11-21 11-01-14

Bildschirmfoto von 2021-11-21 11-01-26