473,587 Members | 2,501 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.mozil la.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,resizea ble 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 1721
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
4801
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 code will trace these coordinates on the image and draw the line between these two points. Can anyone please help me in writing the javascript code...
0
1348
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 that bounces around the screen which I plan to use to learn more about programming in .Net and as a reference for future programs. I placed every...
3
3062
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 making a bitmap map to the control so that when it does a refresh it doesn't need to recalculate everything. It is easy using the form because I...
2
1427
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 etc. This is the solution I have come up with, but it seems a bit convoluted. Before I get too far into the development of the program, could...
6
1909
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 then come back to the form where the picturebox is, the image will disappear and i have to click the button for the image to be visible again. Is...
4
12309
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 drawn on the form by using the following syntax. Basic syntax (for line, rectangle, square) ============================= OBJECT.LINE (X1, Y1) ...
3
2063
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
1777
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 (0,0) always?? or when a canvas is generated it gets global coordinates and so I have to try catch them another way? Thanks for your time
5
2104
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
3549
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 excellent transforms specified on Bob Powell's site, I still wonder if there's an easier way of centering it than the following procedure? Here is...
0
7920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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 we have to send another system
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.