react-native-charts-wrapper icon indicating copy to clipboard operation
react-native-charts-wrapper copied to clipboard

Center text in markers

Open JohnBerd opened this issue 3 years ago • 1 comments

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 avatar Nov 14 '22 20:11 JohnBerd

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.

JohnBerd avatar Nov 16 '22 08:11 JohnBerd