已知轴上的 SVG 折线图

发布于 2024-10-06 13:52:57 字数 495 浏览 0 评论 0 原文

我想动态创建折线图(svg 格式)。 Like this

但是 svg 坐标系是相反的。像这样:

当我有像(0,9),(1,3),(2,6这样的点时),图表将从上到下绘制。 但 svg 有 旋转 功能。但当它向左(- 方向)转动时,最后一个值将是第一个点。

我需要像镜像一样绘制折线图。但是有像旋转或缩放功能这样的镜像功能:(

有没有办法在简单的xy坐标上绘制折线图,​​例如:

Known xy轴

I want to create dynamically line chart (svg format).
Like this

But svg coordinate system works inverse. Like this:

SVG Coordinate

When I have points like (0,9),(1,3),(2,6), graph will be drawing top to bottom.
But svg has rotate function. But when it turned to left (- direction) last value will be first point.

I need to draw line chart like mirroring it. But there is mirror function like roate or scale function :(

Is there any way to draw line chart on simple x y coordinates like :

Known x y axis

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他不在意 2024-10-13 13:52:57

镜像是以负值进行缩放。如果你将 y 轴缩放 -1,你应该得到你想要的。

Mirroring is scaling by a negative amount. If you scale the y-axis by -1 you should get what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文