react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

how to change color of one Dot in LineChart?

Open Escalion86 opened this issue 6 years ago • 4 comments

how to change color of one Dot in LineChart?

Escalion86 avatar Nov 23 '20 07:11 Escalion86

@Escalion86 I believe renderDotContent will be helpful for you, it has 3 parameters x,y and index, you can render the dot as you like for every dot by these parameters.

renderDotContent={({ x, y, index }) => { return renderDotContent(x, y, index); }}

aly-simplehabit avatar Nov 29 '20 11:11 aly-simplehabit

Yes, but not same time... If I have 2 or more charts in one.. Because, dots in index in all charts change

Escalion86 avatar Nov 29 '20 15:11 Escalion86

you could use getDotColor

ex)

getDotColor={(dataPoint, dataPointIndex) => {
        if (dataPointIndex === 0) {
          return 'transparent';
        }
        return dotColor;
    }
}

jejecrunch avatar Jul 21 '21 04:07 jejecrunch

v7.0.0 is now available, so we're closing older issues and PRs from previous versions to keep the tracker focused on the current release. Please try the new version, and if you still have an issue, open a new one with the latest details and a reproduction.

bermanto avatar Jun 27 '26 18:06 bermanto