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

Message ListMessage List     Post MessagePost Message

  SurfaceChart data point highlighting
Posted by Michael P on Jan-09-2018 00:55
Hi there,

what would be the easiest way to highlight one data point in a (3D) SurfaceChart?
I quickly tried to achieve the merge with the ThreeDScatterchart mentioned here http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=merge&thread=1382004235#N1468520030
, but the generated file does not show any scatter element.

best regards,
Michael

  Re: SurfaceChart data point highlighting
Posted by Peter Kwan on Jan-09-2018 14:01
Hi Michael,

Have you tried the exact original code in the thread:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=merge&thread=1382004235#N1468520030

The above code should create a chart image "aaa.png". Does it include the scatter symbols in your case?

When you use the above method in your code, have you started from the line "c->layout();". The code would not work without this line.

Another method to add a shape to the chart is to simply draw a polygon with the DrawArea object. It is like:


.... create 3D surface chart as usual ....

// Draw the 3D surface chart, and obtain the DrawArea object
DrawArea *d = c->makeChart();

// Draw a polygon on top of the surface
double x = c->getXCoor(0, 0, 0);
double y = c->getYCoor(0, 0, 0);
double diamondX[] = { x, x + 5, x, x - 5 };
double diamondY[] = { y - 5, y, y + 5, y };

d->polygon(DoubleArray(diamondX, 4), DoubleArray(diamondY, 4), 0xff0000, 0xff00ff);


Regards
Peter Kwan

  Re: SurfaceChart data point highlighting
Posted by Michael P on Jan-09-2018 16:25
Well, the problem was indeed the missing c->layout() ...
now it works, thanks again!