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

[Feature Request] yMarkers text left-aligned #140

Closed
ucffool opened this issue Mar 22, 2018 · 1 comment
Closed

[Feature Request] yMarkers text left-aligned #140

ucffool opened this issue Mar 22, 2018 · 1 comment

Comments

@ucffool
Copy link

ucffool commented Mar 22, 2018

Expected Behaviour

yMarkers: [
  {
	label: "Average",
	value: 20,
	type: 'dashed',
	pos: 'left'
  }
]

Actual Behaviour

no effect

Code Effect

It looks like inside draw.js the x position is determined by x: width - getStringWidth(label, 5) - LABEL_MARGIN. I'm possibly not looking at the right place, but it seems this is fixing it to right alignment no matter what.

As a side note, ChartCompenents.js there is this:

yMarker(marker.position, marker.label, this.constants.width,
{pos:'right', mode: 'span', lineType: 'dashed'})

Which is what led me to believe there was a way to change the position by passing a value.

Frappé Charts version: 1.0.0

@pratu16x7 pratu16x7 mentioned this issue Apr 20, 2018
@pratu16x7
Copy link
Contributor

You can as of v1.1.0 add a options: { labelPos: 'left' } to a yMarker property:

yMarkers: [{ label: "Marker", value: 70, options: { labelPos: 'left' }}]

Cheers!

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

2 participants