Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing Windrose #152

Open
WolfgangFahl opened this issue Aug 11, 2018 · 0 comments
Open

Showing Windrose #152

WolfgangFahl opened this issue Aug 11, 2018 · 0 comments

Comments

@WolfgangFahl
Copy link

I'd like to get a Windrose-like display:
see https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Brosen_windrose.svg/600px-Brosen_windrose.svg.png

For a start it would be helpful to modify the way the Helper function works by making the counter display in Helper drawRadialTickMarks configurable e.g. separating the String.format ... function in

   Helper.rotateContextForText(CTX, START_ANGLE, angle, tickLabelOrientation);

                    CTX.setFont(isNotZero ? tickMarkFont : tickMarkZeroFont);
                            CTX.setTextAlign(TextAlignment.CENTER);
                            CTX.setTextBaseline(VPos.CENTER);
                            CTX.fillText(getTextForCounter(locale, tickLabelFormatString, counter), 0, 0);
                            CTX.restore();

to:

public String getTextForCounter(Locale locale,
String tickLabelFormatString, Double counter) {
String result=String.format(locale,tickLabelFormatString,counter);
return result;
}

If the helper would now be non-static by initializing it with new Helper() and calling drawRadialTickMarks it would be possible to exchange the Helper at runtime.

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant