coinjar / react-native-wagmi-charts

A sweet & simple chart library for React Native that will make us feel like We're All Gonna Make It.
MIT License
589 stars 116 forks source link

[QUESTION] No format prop for LineChart.Tooltip #132

Closed shivansal closed 1 year ago

shivansal commented 1 year ago

Hi. I am trying to customize the value shown when pressing down on a point in the graph. In specific, I want to add a dollar sign in front of the value to indicate a currency value. Please let me know if anyone has been able to accomplish this or if I am looking at the wrong prop object. Thank you.

arancauchi commented 1 year ago

Hey @shivansal yes that's indeed possible to change the formatting on the cursor tooltip. You can do so as follows:

  const format = ({ value }) => {
    'worklet'
    return `$${value}`
  };

    return (
        ...
            <LineChart.Tooltip textProps={{ format }}  />
        ...
    );
shivansal commented 1 year ago

Ah okay. thank you