The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
Homework - Bar Chart with Movable/dragable shapes
Discuss Bar Chart with Movable/dragable shapes in the Java Help forum on Dev Shed. Bar Chart with Movable/dragable shapes Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 10th, 2013, 01:23 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 6
Time spent in forums: 37 m 40 sec
Reputation Power: 0
|
|
|
Homework - Bar Chart with Movable/dragable shapes
This is Sai,
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.
Please anyone can open up your suggestions.

|

January 10th, 2013, 06:14 AM
|
 |
Contributing User
|
|
Join Date: Aug 2010
Location: Eastern Florida
|
|
|
Is this on an html page displayed in a browser? Sounds like a javascript application, not java.
|

January 10th, 2013, 11:20 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 6
Time spent in forums: 37 m 40 sec
Reputation Power: 0
|
|
|
I agree
Hi NormR,
I agree with you but the thing is by using java script while drag and drop it is not accurate and if the no of shapes become huge then it takes so much time to load so can you suggest me better solution.
This is my main problem:-
the back ground layer(where all the shapes are placed) I took was a table so while drag and drop the challenge is I had to consider each and every id of <td> so script takes so much time so is there any alternate for this ?????
Thanks for your valuable time
|

February 25th, 2013, 06:55 AM
|
|
Contributing User
|
|
Join Date: Mar 2011
Posts: 117
Time spent in forums: 1 Day 29 m 41 sec
Reputation Power: 0
|
|
|
Solutions is...
Hi
Please find the solutions
Code:
<script type="text/javascript" src="http://highcharts.com/js/testing.js"></script> <div id="container" style="height: 300px; width: 400px; border: 1px solid black;"></div> var renderer = new Highcharts.Renderer( $('#container')[0], 400, 300 ), rect = renderer.rect(100, 100, 100, 100, 5), clickX, clickY; var start = function(e) { $(document).bind({ 'mousemove.rect': step, 'mouseup.rect': stop }); clickX = e.pageX - rect.translateX; clickY = e.pageY - rect.translateY; } var step = function(e) { // console.log( rect.translate(e.pageX - clickX, e.pageY - clickY) } var stop = function() { $(document).unbind('.rect'); } rect.attr({ 'stroke-width': 2, stroke: 'red', fill: 'yellow', zIndex: 3 }) .translate(0,0) .on('mousedown', start) .add();
Thanks
Diya
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|