Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using dataSet, only one pointer is displayed on the line chart. #610

Closed
HikaruTakemoto opened this issue Apr 19, 2024 · 3 comments
Closed

Comments

@HikaruTakemoto
Copy link

I am using dataSet to draw six lines on a line chart. I think that when you drag on the chart, points appear on the lines. However, points only appear on the first line.

  const dataSet: Array<DataSet> = [
  	{ data: data1, color: "blue", dataPointsColor: "black" },
  	{ data: data2, color: "green", dataPointsColor: "black" },
  	{ data: data3, color: "orange", dataPointsColor: "black" },
  	{ data: data4, color: "red", dataPointsColor: "black" },
  	{ data: data5, color: "purple", dataPointsColor: "black" },
  	{ data: data6, color: "pink", dataPointsColor: "black" },
  ];

<LineChart
  				adjustToWidth
  				curved
  				hideDataPoints
  				height={100}
  				overflowTop={15}
  				maxValue={500000}
  				dataSet={dataSet}
  				initialSpacing={0}
  				noOfSections={4}
  				thickness={1}
  				rulesType="solid"
  				rulesColor="lightgray"
  				getPointerProps={(index: PointerIndex) => {
  					console.log(index);
  					setActivePointerIndex(index.pointerIndex);
  					setActivePointerX(index.pointerX);
  				}}
  				pointerConfig={{
  					pointerStripColor: "black",
  					pointerStripWidth: 2,
  					pointer1Color: "blue",
  					pointer2Color: "green",
  					pointer3Color: "orange",
  					radius: 4,
  				}}
  			/>
@HikaruTakemoto
Copy link
Author

2024-04-19.10.56.16.mov

@vorn-dev-ni
Copy link

Same only 1 item or pointer is displayed

@Abhinandan-Kushwaha
Copy link
Owner

Hi @HikaruTakemoto 👋
Thanks for pointing it out. It has been fixed in version 1.4.11 🎉

Now the pointer will appear on each line of the dataSet. If you want the pointers to be of different colors, you can pass the colors in an array using the prop pointerColorsForDataSet.

Please use the latest version of the library.

cc: @vorn-dev-ni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants