|
How to implement drawing tools on chart? |
Posted by Manisha on Aug-14-2015 15:15 |
|
Hi, Peter,
Can you please let me know how can i implement the drawing tools on chart using chart
director code, also can you please provide my the code for the same.
Please find the attached image, what i am looking for
|
Re: How to implement drawing tools on chart? |
Posted by Peter Kwan on Aug-14-2015 23:24 |
|
Hi Manisha,
ChartDirector can only draw the chart. For interactive drawing, you would need to
implement it with your own code. Basically, you would need to develop something like
"Windows Paint" to allow the user to interactively draw on an image (such as the chart).
Regards
Peter Kwan |
Re: How to implement drawing tools on chart? |
Posted by Manisha on Aug-17-2015 14:52 |
|
Hi Peter,
Thats ok if the chart director does not support any drawing tool implementation, so what
actually is the use of these drawing objects like given in the url http://www.advsofteng.com/doc/cdpydoc/DrawArea.htm like rect, polygon etc.
How can we implement this on our chart image. |
Re: How to implement drawing tools on chart? |
Posted by Daniel on Aug-17-2015 17:35 |
|
Hi Manisha,
I have used Chartdirector extensively to deliver the functionality you are looking for. Successfully so:)
The idea (that you indeed got clear) is to :
1- build the base-plot and keep the reference in memory, session-wise, as long as you need to touch it up,
2- use the user-input to build the "additional layer" with initDynamicLayer, add everything you might need
3- output the result to what you might need for display (we use plain-old png),
4- clear the added layer and back to step 2!
We offer data drilling (requires you keep information on you object placement X and Y pixels values with CD adequate functions), basic labelling and visual banding. What you can do is indeed limited by the drawarea primitives. Not a problem as far as we are concerned.
Quite easy and workable even from within relatively lousy MS scripting tools. The performance is great even for object D'nD. Quite an achievement:)
All in all, I would possibly not create a paintnet alternative with CD. But offering customization to the great chart output produced by CD and - even more so - visual data drilling, YEP!
Daniel
PS: Chartdirector is indeed a great product. We only have one serious issue i-e when outputting to PDF vectorial format, should wish to offer it on top of other output formats.
As far as we were able to find out by ourselves, the TTFText.getwidth() - used when adding text objects at runtime via the draweara API - does not return proper information when rendering pdf output. We made Peter aware of this 6.0 version issue with a series of recent emails and are eagerly waiting for his corrections to deliver natively vectorial pdf output to our users on top of screen display, clipboard copy and other raster formats. |
Re: How to implement drawing tools on chart? |
Posted by Peter Kwan on Aug-18-2015 01:04 |
|
Hi Manisha,
Like all other ChartDirector API, the DrawArea API is to draw things programmatically. It
means your code can draw things using these API. This is not the same as interactive
drawing. For interactive drawing, you need to handle the user inteactions (allow the user to
use the mouse the drawing things, and select things to edit or change, and to delete or
move things, etc). Also, for web applications. because ChartDirector runs on the server
side, but the user interface runs on the browser side, so it is difficult for the browser side
user interaction code to use server side ChartDirector to draw things.
Regards
Peter Kwan |
|