ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  SVG clickable
Posted by Thexder ho on Sep-23-2022 16:53
Hi Peter,

I need to draw a clickable SVG, does latest ver. ChartDirector support this?

I know ChartDirector can load SVG file and display, but how can I make the image object clickable and interacting with cursor move?



  Re: SVG clickable
Posted by Peter Kwan on Sep-24-2022 00:44
Hi Thexder,

Yes, ChartDirector can output in SVG. If used on a web page, the SVG is clickable just like PNG/JPG/GIF. You may try the ChartDirector 7.0 sample code. All of them now outputs in SVG and have tooltips and can be made clickable. The programmable track cursor sample code demonstrates how it can respond to mouse move to update the track cursor.

In short, making the charts clickable is the same no matter you are using SVG or other image formats. In typical usage, the chart is displayed using an image tag like <IMG SRC=".....someURL....."  ...../>. The ....someURL.... can point to a PNG or SVG image. The IMG tag can associate with an image map to be it clickable.

Note that in the ChartDirector 7 sample code, we have included the ChartDirector Javacript Library "cdjcv.js" by default in all web pages. One of its function is to handle image maps for dynamically resized images. It is because HTML image map does not support resizing, and it will not work if the image is not displayed at its original size. (This is not specific to ChartDirector, but occurs for any image that uses image maps.) The "cdjcv.js" dynamically adjusts the HTML image map to work around this issue.

In the ChartDirector 7 sample code, we also use inline data protocol for the image URL, which eliminates the need for the "getchart.php" in previous versions of ChartDirector. The <IMG> tag with the inline data protocol URL is automatically generated by the WebChartViewer in ChartDirector 7, so you do not need to create the <IMG> tag explicitly.

Best Regards
Peter Kwan

  Re: SVG clickable
Posted by Thexder ho on Sep-28-2022 08:01
Thank you Peter, thanks for your hints,

I'm now working on it, hope I can solve this problem.

Best Rgds,