最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ChartJs Force scatter plot to be square shaped - Stack Overflow

programmeradmin5浏览0评论

I am trying to create a scatter plot where XAxes and YAxes is the same scale and size. The plot will bee 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.

I am trying to create a scatter plot where XAxes and YAxes is the same scale and size. The plot will bee 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.

Share asked Jan 17, 2018 at 21:33 JooJoo1020JooJoo1020 952 silver badges8 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

in dataset you can set the pointStyle.

      datasets: [{pointStyle:'rect'}]

for the other types

Just found it : just add aspectRatio: 1 to options

发布评论

评论列表(0)

  1. 暂无评论