使用 JavaScript 绘制带有可点击点的线条 [英] Drawing lines with clickable points using JavaScript

查看:37
本文介绍了使用 JavaScript 绘制带有可点击点的线条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用 JavaScript 进行绘图感兴趣.我直接举个例子:

I'm interested in doing some drawing using JavaScript. I'll get straight to an example:

替代文字 http://img693.imageshack.us/img693/3774/linep.png绿色的水平线是静态的,所有的垂直线都是可点击的.点击行的一个例子是红色的.

alt text http://img693.imageshack.us/img693/3774/linep.png The green horizontal line would be static, and all the vertical lines would be clickable. An example of a clicked line would be the red one.

我见过很多 API,但它们都允许比我需要的更复杂,使其变得不必要.

I've seen many API's, but they all allow more complexity than I need, making it more complicated than necessary.

对好的 API 有什么建议吗?自己做?

Any suggestion for a good API? Make it oneself?

推荐答案

最初您可以使用 CSS 和 html 来组成这些行.然后将其中的一些转移到 JS 中.对我来说,从你所描述的情况来看,从头开始做起来并不难.

You could use CSS and html to make up the lines initially. Then transfer some of this into the JS. To me from what you have described it doesn't look that difficult to do from scratch.

可能还有一些你没有提到的东西!

There's probably something else you haven't mentioned though!

这篇关于使用 JavaScript 绘制带有可点击点的线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆