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

Message ListMessage List     Post MessagePost Message

  How to display data 'foreground'?
Posted by Jackie on Jan-19-2011 01:39
Hi,
i am using a line chart...and having a problem seeing some data as it is displayed behind the line...is there a way to display the data in the foreground?  thank you.

  Re: How to display data 'foreground'?
Posted by Peter Kwan on Jan-19-2011 02:58
Hi Jackie,

As you mentioned you have "some data" displayed behind the line, I assume you have two layers, one of which is a line layer, and the other layer is behind the line layer.

To make the other layer in front of the line layer, you may reverse the order that you added the layers. (Add the other layer first, and the line layer last.)

Alternatively, you may use Layer.moveFront and Layer.moveBack to move a layer to the front or to the back.

Hope this can help.

Regards
Peter Kwan

  Re: How to display data 'foreground'?
Posted by Darryl on Jan-19-2011 03:52
On that subject, I would like to be able to bring a layer to the front when the mouse is clicked on the associated legend item.

In my case, each data set is associated with its own layer, and I have successfully implemented a clickable legend (MFC, by the way), but I can't figure out how to get the layer in the image map handler for the legend or the chart.

I've looked through the samples and references, but I'm stuck on this one. Any help you can offer would be greatly appreciated. Thank you in advance.

  Re: How to display data 'foreground'?
Posted by Peter Kwan on Jan-19-2011 17:47
Hi Darryl,

When the user clicks on the legend entry, simply redraw the chart with the clicked layer on top.

I assume you already know how to make a layer to appear on top (eg. use Layer.moveFront). You can put your charting code in a subroutine like:

void drawChart(int layer_index)
{
   ... draw the chart with the layer_index on top, and display it ....
}

To draw the initial chart, you may call drawChart with any layer_index you want to initially appear on top (say just use 0). Later, when the user clicks on the legend entry, you can call the subroutine again, based on which entry the user has clicked.

Hope this can help.

Regards
Peter Kwan

  Re: How to display data 'foreground'?
Posted by Darryl on Jan-21-2011 06:49
I got it worked out in a similar fashion. Thank you very much for your help.