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

Message ListMessage List     Post MessagePost Message

  DrawArea does not work .. ?
Posted by Kai on Aug-02-2011 00:30
Dear Peter,

I overrid CChartViewer to get a moving circle-symbol on my Chart. Anyway, since all
other aspects seems fine, the DrawArea-Method misses to work (I call it from a mouse-
move routine):

void CChartViewerEx::drawCircle( int iXPoint, int iYPoint )
{
BaseChart* pBC = this->getChart();
DrawArea* pDA = pBC->getDrawArea();
pDA->circle(m_iCircleX, m_iCircleY, 10, 10, 0x555555,0x222222);
}

iXPoint and iYPoint are the coordinates for the circle symbol.
How could I get that work?

Second question: If it works, how can I delete that circle in a way, that follows the mouse
position (the coordinates from my imagemap)?

Thanks a lot!
Kai

  Re: DrawArea does not work .. ?
Posted by Peter Kwan on Aug-02-2011 01:33
Hi Kai,

After updating the chart, you would need to display the chart again:

this->setChart(pBC);

There is no way to remove anything from the BaseChart object. The only method to remove things is to create a new chart object, and redraw everything except the things you want to remove.

From your code, it seems your intention is to draw a fancy "mouse cursor". In my opinion, it is not ideal to consider the "mouse cursor" to be part of the chart or to be something drawn on the chart. For example, consider the normal mouse cursor (a pointer). You can use the "pointer" mouse cursor to activate tooltips or click on hot spots on the chart. However, the "pointer" is not part of the chart. It is a completely separate control that happens to float over the chart. Your "circle cursor" can be handled in a similar way (as a completely separate control that can move over the chart). In this way, you do not need to modify the chart, and you do not need to worry about deleting the cursor.

Hope this can help.

Regards
Peter Kwan