xanderdeseyn / react-native-responsive-linechart

A customizable and responsive line or area chart for react-native
https://react-native-responsive-linechart.surge.sh
MIT License
202 stars 46 forks source link

HorizontalAxis formatter with index param? #123

Open mzu opened 2 years ago

mzu commented 2 years ago

Hi. Quick question regarding HorizontalAxis. Is there a way to access the index of the tickValues as a param in formatter?

Something like:

          <HorizontalAxis
            tickValues={dataPoints}
            theme={{
              labels: {
                formatter: (v, index) => renderDataLabel(v, index),
              },
            }}
          />

It would help rendering additional context for the given dataPoints as part of the labels on the x-axis.

If this or an alternative solution is not possible, would it be hard to add this as a feature?