artus9033 / chartjs-plugin-dragdata

Draggable data points plugin for Chart.js
MIT License
257 stars 55 forks source link

Precise dragging is required when moving points within a radar chart. #105

Open shochu-hiracchi opened 1 year ago

shochu-hiracchi commented 1 year ago
  Precise dragging is required when moving points within a radar chart.

If you pass from the center point, the point will stretch in the opposite direction, and so on.

What I want to do is in the second table. Dragging only operates within the axis and has no effect on other axes. (It does not extend to the other side even if it passes the center.

shochu-hiracchi commented 1 year ago

ecise dragging is required when moving points within a radar chart.

https://user-images.githubusercontent.com/114906039/193757625-489bea5c-7937-491e-80d8-d20b99fb3a38.mp4

https://user-images.githubusercontent.com/114906039/193757631-6f03b9ed-eef1-4a24-a348-f1bdf9f6aa24.mp4

chrispahm commented 1 year ago

Thanks @shochu-hiracchi for raising an issue!

This is indeed a bug. Without digging into this, I'm assuming that this is due to our custom logic in the calcRadar method https://github.com/chrispahm/chartjs-plugin-dragdata/blob/master/src/index.js#L78. Since v3, Chart.js does expose a getValueForPixel method for Radar charts, which potentially does not have this issue. I'm currently tight for time, but happy to accept a PR that updates the method.

YBCoding commented 1 year ago

@chrispahm I've provided a PR for this =)