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

Message ListMessage List     Post MessagePost Message

  Trace is not visible if it overlaps over plot border in XYChart
Posted by R on Apr-13-2018 16:06
Hi,

How do I force the chart do override the PlotArea border (edgeColor) and the Axes lines?
When a Layer is overlaps the border of the plot area, the border override the layer, and the layer is hidden, how can I change it?

Thanks,
Rachel.

  Re: Trace is not visible if it overlaps over plot border in XYChart
Posted by Peter Kwan on Apr-14-2018 06:24
Hi R,

At the plotarea border, besides the border itself, there are also the x-axis and y-axis. There are also grid lines.

The grid lines are under the layers, while the axis and the plotarea border are on top of the layers.

For your case, the most common method is to simply set the plotarea border to transparent (Chart::Transparent in C++ and Chart.Transparent in .NET/Java, ...). The plotarea border color can be configured when your code calls setPlotArea. See:

http://www.advsofteng.com/doc/cdcpp.htm#XYChart.setPlotArea.htm

After that, the layer can still be covered by the axis. You can set the axis stem to transparent as well. The followings are some sample code that uses transparent axes:

http://www.advsofteng.com/doc/cdcpp.htm#multiline2.htm
http://www.advsofteng.com/doc/cdcpp.htm#unevenpoints.htm
http://www.advsofteng.com/gallery_realtimeviewport.html

If you prefer a non-transparent axis, you can move the axis a little away (1 or 2 pixels) from the plot area using Axis.setOffset. It is like:

// move the x-axis down by 2 pixels
c->xAxis()->setOffset(0, 2);

Another method is to add a small "axis margin", like:

c->yAxis()->setMargin(2, 2);
c->xAxis()->setMargin(2, 2);

Hope this can help.

Regards
Peter Kwan