Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChartJs Force scatter plot to be square shaped

I am trying to create a scatter plot where XAxes and YAxes is the same scale and size. The plot will become a square with identical Axes. Therefore if the data be {x:0, y:0}, {x:100, y:100} it draws a diagonal (45 degrees) line. I am plotting A vs. B and the rectangular shape of the plot is confusing.

The max values are known ahead of time.

like image 912
JooJoo1020 Avatar asked Apr 24 '26 04:04

JooJoo1020


1 Answers

in dataset you can set the pointStyle.

      datasets: [{pointStyle:'rect'}]

for the other types

like image 170
ilhank Avatar answered Apr 25 '26 17:04

ilhank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!