I have a composite chart containing serveral barcharts. I want to add a vertical line at a certain position of the x-axis. It should be possible to add/remove this line with a button. Since I also want to display/hide other primitives, I figured the best way would be to implement a custom layer that implements the ILayer interface.
My problem is now, that I cannot access the x-axis from within the FillSceneGraph event, since I don't get the FillSceneGraphEventArgs in this event handler. I would like to use the map function of the axis to get the position at which to draw the line.
Is there any way to access the axis or is there another way to do this?
Any help is appreciated!
You're better off handling FillSceneGraph event of the chart control. This event eliminated the need to implement ILayer. When dealing with composite charts, you need to get the Grid hashtable directly from the composite layer, like this:Hashtable grid = ultraChart1.CompositeChart.ChartLayers[index].ChartLayer.Grid
You'll see that the grid contains two axes used by the layer. Then, you can cast them as IAdvanceAxis and use the mapping functions. With the ILayer, you don't get the reference to your chart control, but you can easily supply that reference, since it's your own custom class.
Hope this makes sense.
Thanks, that worked. It's sometimes quite confusing working with NetAdvantage...