indiespirit / react-native-chart-kit

📊React Native Chart Kit: Line Chart, Bezier Line Chart, Progress Ring, Bar chart, Pie chart, Contribution graph (heatmap)
https://expo.io/@indiespirit/react-native-chart-kit
MIT License
2.85k stars 658 forks source link

Limiting number of values in x-axis #691

Open uhfonso opened 1 year ago

uhfonso commented 1 year ago

Hi, I would like to know if there is a way to limit the number of points i want to display on the X-axis label. Please let me know if there is any possible way.

Thanks!

theinventor27 commented 1 year ago

Did you find a solution? I am trying a way to limit the values on the y axis

dpanjkovic commented 8 months ago

do something like this

let labelIndex = 0; let skipLabelEvery = 3;

then use formatXLabel prop

      formatXLabel={(value) => {
        labelIndex++;
        return labelIndex % skipLabelEvery === 0  ? value : "";
      }}