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

Marker customization

Open farouk-abdelkrim opened this issue 2 years ago • 12 comments

Hello,

It 's possible to make custom marker in LineChart? if not how i can change the position of arrow in the marker

farouk-abdelkrim avatar Mar 21 '22 16:03 farouk-abdelkrim

the same issue with stackedBarchart

dinhnhanfpt avatar Mar 31 '22 06:03 dinhnhanfpt

any update on marker customization

empiteranga avatar Jun 05 '22 06:06 empiteranga

You can use the marker prop of LineChart:

marker={{
                  enabled: true,
                  markerColor: processColor(commonColor.listItemBackground),
                  textSize: scale(12),
                  textColor: processColor(commonColor.textColor)
               }}

and add a marker property with a string value to each point of your data array

AlixH avatar Jun 20 '22 13:06 AlixH

Any form of setting the marker's border radius and content padding?

ger88555 avatar Jul 22 '22 05:07 ger88555

Do you have any plans to add custom markers? In our case, we need to add a border and a specific style to the marker content

lvntyldz avatar Aug 05 '22 09:08 lvntyldz

Any update on this? @ger88555 @lvntyldz @AlixH @farouk-abdelkrim Did you guys got any solution or approach?

christopher-18 avatar Oct 24 '22 05:10 christopher-18

@christopher-18 I'm still unable to customize the marker. As a workaround, I'm using a custom, sticky title at the top of the chart that displays the selected datum's information (if any is selected).

I get the selected datum through the onSelect prop of LineChart and I clear any selected datum through the onTouchEnd/onTouchRelease props of the parent view.

I'm still hoping for a more customizable marker (at least on padding, margin, and border) in the future. It would allow the marker to successfuly blend with the rest of the App's UI.

ger88555 avatar Nov 18 '22 05:11 ger88555

It will be really cool to have this implemented

Eramirez06 avatar Dec 27 '22 08:12 Eramirez06

any update on this?

southxzx avatar Mar 22 '23 07:03 southxzx

I highly recommend providing the availability to customize the marker to accept a Jsx elements instead of string so, anyone use the library can make any customization with the styles he needs @wuxudong

HasanElfalt avatar Dec 06 '23 08:12 HasanElfalt

@HasanElfalt I can't access Jsx elements in native code.

wuxudong avatar Dec 06 '23 10:12 wuxudong

I think there is a way, I had seen this made, but I don't know actually how it is done @wuxudong

HasanElfalt avatar Dec 07 '23 07:12 HasanElfalt