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

Center text in markers #918

Open
JohnBerd opened this issue Nov 14, 2022 · 1 comment
Open

Center text in markers #918

JohnBerd opened this issue Nov 14, 2022 · 1 comment

Comments

@JohnBerd
Copy link

Do read files under lib/* before reporting issues, you can find all the config there, all of them are straightforward.

Expected Behavior

Text should be in center of the marker

Actual Behavior

Text is at the left

Screenshots

Capture d’écran 2022-11-14 à 21 02 53

Steps to Reproduce the Problem

Create a chart with markers

Specifications

  • Version: 0.5.11
  • Platform: IOS
@JohnBerd
Copy link
Author

JohnBerd commented Nov 16, 2022

I don't have time at the moment for making a PR, but it seems like values are not declared in the typescript part even they are read in the Swift code, here is my patch. center should be the default value as it is in the Android side.

diff --git a/node_modules/@types/react-native-charts-wrapper/index.d.ts b/node_modules/@types/react-native-charts-wrapper/index.d.ts
index 48e804a..2fcb5a5 100755
--- a/node_modules/@types/react-native-charts-wrapper/index.d.ts
+++ b/node_modules/@types/react-native-charts-wrapper/index.d.ts
@@ -4,7 +4,7 @@
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
 import { Component } from 'react';
-import { ViewProps, NativeSyntheticEvent, processColor } from 'react-native';
+import { NativeSyntheticEvent, processColor, ViewProps } from 'react-native';
 
 export type EasingType =
     | 'Linear'
@@ -195,6 +195,7 @@ export interface ChartBase extends ViewProps {
         markerColor?: Color | undefined;
         textColor?: Color | undefined;
         textSize?: number | undefined;
+        textAlign?: 'auto' | 'justify' | 'center' | 'left' | 'right'
     } | undefined;
 
     highlights?: Array<{

So the marker props can take a textAlign value.

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