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

Message ListMessage List     Post MessagePost Message

  yAxis labels as links
Posted by Treavor Gagne on Sep-29-2021 02:10
Hey,

I am using Chart Director in PHP. I have a heatmap displaying data with a date viewport. I was just wondering how do make all the yAxis labels unique links on the heatmap?

Treavor

  Re: yAxis labels as links
Posted by Peter Kwan on Sep-29-2021 12:43
Hi Treavor,

The "Clickable Charts" sample code include in the ChartDirector distribution demonstrates how to make various chart objects clickable by using image maps. In case you are not aware of image maps, you may refer to these examples for the code structure:

https://www.advsofteng.com/doc/cdphp.htm#clickablecharts.htm

One thing missing in the sample code is it does not demonstrate the image map for axis labels. The axis label image map can be generated with:

https://www.advsofteng.com/doc/cdphp.htm#Axis.getHTMLImageMap.htm

In the simplest case, you can use:

$axisImageMap = $c->yAxis->getHTMLImageMap("aaa.php");

The link for each label will be "aaa.php?label=xxx&value=yyy". The links are unique as long as the axis labels and values are unique. You can then use the image map like in the clickable charts sample code, such as:

$viewer->setImageMap($axisImageMap);

Regards
Peter Kwan

  Re: yAxis labels as links
Posted by Treavor Gagne on Sep-30-2021 00:47
Hey Peter,

That solution works for what I'm trying to do, but it seems that my data tool tips are now unresponsive. Is it not possible to have 2 ImageMap set. Currently, I have one for heatmap chart body for tooltips and the one for the yAxis for links, but the one I call last seems to be the one that is active.

Treavor

  Re: yAxis labels as links
Posted by Peter Kwan on Sep-30-2021 00:51
Hi Treavor,

Yes, just append the image maps together, as in the Custom Clickable Objects sample code:

https://www.advsofteng.com/doc/cdphp.htm#customclickable.htm

It is like:

# The image map for axis labels
$axisImageMap = $c->yAxis->getHTMLImageMap("aaa.php");

# The image map for the data points
$dataPointImageMap = $c->getHTMLImageMap(.....);

$viewer->setImageMap($axisImageMap . $dataPointImageMap);


Regards
Peter Kwan

  Re: yAxis labels as links
Posted by Treavor Gagne on Sep-30-2021 01:04
Great, thank you.