473,513 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drawing shapes on a canvas with respect to x and y co-ordinates?

1 New Member
Hi there,
This is Sai.

https://developer.mozilla.org/en-US/docs/HTML/Canvas/Tutorial/Drawing_shapes

In my web application as a user I will put some points on the bar chart(which contains X and Y axis) and then when I click on button all the points should join & form a shape and when I drag and drop that particular shape to other place in that bar chart it should able to read the chart coordinates and I can able to resize that shape.
Like this there are many shapes in that bar chart.
How to do this??

I don't know any charting mechanism for bar charts which allows us to create movable,resizeable shapes that is why I have taken table and divided each <td> like a block so that each <td> contains an id its row and column no
for example row 2 nd and column is 5
then its id is 25.

I have taken HTML5 as the basic things to draw irregular shapes and to drag and drop and resize the shapes which are placed on canvas.and canvas is placed on table.
User will put some points on the graph(table) and then when he clicks a button called “Plot”, a shape is formed by connecting all the points, like this user can create as many number of shapes he wants(please check the attached screen shot.
Now after creating shapes user can also drag them to other place in the chart in order to do this canvas is becoming obstacle because canvas size is larger than one particular shape so when I am trying drag and drop entire canvas is moving and same time I am unable to read the co-ordinates because shapes are not moving directly on table but those are drag and dropping on canvas which is invisible.

So how can get rid of this???

If you observe the above link mentioned, I am also expecting same output(image ) but what I want is the shape can be anything and that can be drag and drop on that canvas and while drag and drop, I should able to capture the present co-ordinates ???


Can anyone give me your valuable suggestions.
Jan 30 '13 #1
1 1693
Rabbit
12,516 Recognized Expert Moderator MVP
You didn't attach the screenshot you said you would attach.

I haven't used a canvas before but for those who have and who can help you, they would need to see your code.
Jan 30 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
4783
by: Atif | last post by:
Hello all, In my html page I want to add an image say of 800x600. Now I want that when ever I am given two coordinates on this image say (x1, y1)=(50, 100) and (x2, y2)=(200, 300), the java script...
0
1346
by: Jack | last post by:
I am just beginning to get into designing (hand-coding) forms with .Net using C++. I am trying to write a very simple application that has buttons on it and draws a black ball every 10 milliseconds...
3
3056
by: steve bull | last post by:
I have a program in which I draw various shapes to a form but I would like to move it off the form into a user control. The painting on the form takes a significant amount of time. I was thinking of...
2
1424
by: Martin Horn | last post by:
Hi all, I'm adding basic drawing capability to an application that I am writing, and I have been having problems with making the graphics output persist when the application is re-sized,covered...
6
1906
by: dr3amxstar | last post by:
Hi Im using VB express 2005 I encountered some problems while drawing shapes in visual basic. Whenever i print shape on the picturebox it appears, but when i minimize it or go to another form and...
4
12292
debasisdas
by: debasisdas | last post by:
This article contains the basic syntax to draw graphics of various shapes and sizes in Visual Basic 6.0. Different types of geometrical shapes (rectangle, square, circle, arc, ellipse etc.) can be...
3
2061
by: Omatase | last post by:
Does anyone know how to do this? I want to draw verticle lines that will sit on top of all other windows. Preferably I would do this in c#. Thanks
8
1772
by: Nibbus | last post by:
Hi there, I´m using <canvas> dhtml tag for drawing some lines . The problem is that I generate them in a loop and then I want to draw, but nothing is happening... the coordinates of the canvas are...
5
2099
by: cleary1981 | last post by:
Hi, Can anyone help? Im really stuck. I have an xml document with co-ordinates, lengths and widths. Is there anyway of drawing shapes when using apache fop to generate a pdf?
7
3540
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.