Polygon drawing issue
Polygon drawing issue
We have recently migrated to the latest version of T-Chart i.e. ActiveX 2018. But after migration we are facing difficulty in polygon drawing on canvas which was working fine earlier. Polygon drawing on canvas while working on line-series is working fine. But while drawing polygon, if we mouse hover or click on bubble series then polygon disappears which is not the desired behavior. Interestingly on line-series there is no issue on canvas drawing but the issue is coming on bubble series.
Kindly suggest the code or teechart editor setting so that polygon do not disappear on bubble click or bubble mouse hover.
Regards,
Bhanu
Re: Polygon drawing issue
Hello Bhanu,
I can't find any test application attached but, according to your description, the problem may disappear as soon as you disable the Hover feature by code or at design time:
- By code:
- At design time:
I can't find any test application attached but, according to your description, the problem may disappear as soon as you disable the Hover feature by code or at design time:
- By code:
Code: Select all
TChart1.Hover.Visible = False
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Polygon drawing issue
Thanks for your response. Based on your suggestion we did tried to toggle off the hover settings, but issue still persists. For reference I am attaching code as well as demo application. We would request you to kindly guide us.
Thanks
Bhanu
These are my default settings in code:
Code: Select all
//.......gdi and hover settings........
m_chart.GetAspect().GetGDIPlus().SetActive(FALSE);
m_chart.GetHover().SetVisible(false);
m_chart.Series(0).GetSelected().GetHover().SetVisible(false);
m_chart.Series(1).GetSelected().GetHover().SetVisible(false);
for (int i = 0; i < 10; i++)
{
m_chart.Series(0).GetAsBubble().AddBubble(20*i, i,3, (LPCTSTR)"", RGB(255, 255, 0));
}
for (int i = 0; i < 100; i++)
{
m_chart.Series(1).AddXY(i, i, (LPCTSTR)"", RGB(0, 0, 0));
}
Polygon drawing code:
void CDemoDlg::OnMouseDownTchart1(long Button, long Shift, long X, long Y)
{
if (IsStartDrawing == true)
{
if (Button == 1)
{
if (startX == -1 && startY == -1)
{
startX = X;
startY = Y;
return;
}
if (endX == -1 && endY == -1)
{
endX = X;
endY = Y;
}
if (endX != -1 && endY != -1 && startX != -1 && startY != -1)
{
m_chart.GetCanvas().DrawLine(startX, startY, endX, endY);
startX = endX;
startY = endY;
endX = -1;
endY = -1;
}
}
}
}
Re: Polygon drawing issue
Hello,
I'm not sure how the chart is being repainted when you move the mouse over the bubbles. I've exported your chart to a .tee, imported it into a delphi application (note TeeChart ActiveX is a wrapper from the VCL version), added your code at OnMouseDown event and it seems to work fine; without loosing the lines you are manually drawing.
An alternative would be to store your lines start and end points to an array and draw this array at the Chart OnAfterDraw event. This way, if the chart is repainted, the lines will also be repainted.
I'm not sure how the chart is being repainted when you move the mouse over the bubbles. I've exported your chart to a .tee, imported it into a delphi application (note TeeChart ActiveX is a wrapper from the VCL version), added your code at OnMouseDown event and it seems to work fine; without loosing the lines you are manually drawing.
An alternative would be to store your lines start and end points to an array and draw this array at the Chart OnAfterDraw event. This way, if the chart is repainted, the lines will also be repainted.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Polygon drawing issue
Thanks a lot. This resolves the issue.