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

Message ListMessage List     Post MessagePost Message

  Problems resizing XYChart
Posted by Ian Hammond on Jan-17-2018 03:35
Attachments:
Hi,
I am currently evaluating ChartDirector with the intention of replacing an existing graphic control in a legacy product. I ma trying to resize the graph and I get an effect where the x-axis and y-axes + labels seem to be overwritten in the new size.  I have noticed that if I do a slight correction to the resize the image corrects itself. I have attached an image of the effect I'm trying to convey. Any advice would be much appreciated

Regards
snip2.JPG
snip1.JPG

  Re: Problems resizing XYChart
Posted by Peter Kwan on Jan-17-2018 14:10
Hi Ian,

Are you using MFC with charts with a transparent background?

Due to the limitation of the MFC framework, so far we are unable to make a truly transparent image just using standard MFC. For your case, if there is no other controls under your chart apart from the Form background, may be you can consider to create the chart with the same background color as the Form. In some of our sample code, we detect the background color of the Form using code like the followings:

//
// Get the default background color
//
int CRealtimetrackDlg::getDefaultBgColor()
{
    LOGBRUSH LogBrush;
    HBRUSH hBrush = (HBRUSH)SendMessage(WM_CTLCOLORDLG, (WPARAM)CClientDC(this).m_hDC, (LPARAM)m_hWnd);
    ::GetObject(hBrush, sizeof(LOGBRUSH), &LogBrush);
    int ret = LogBrush.lbColor;
    return ((ret & 0xff) << 16) | (ret & 0xff00) | ((ret & 0xff0000) >> 16);
}

For your information, there is a "Realtime Sweep Chart" sample code in the library section of our web site. It features a chart the resizes when the Window resize. It uses the "ViewPortChanged" mechanism to make the chart resize smoothly while updating in realtime.

http://www.advsofteng.com/gallery_realtime.html


if the above is not the cause of the problem, would you mind to clarify whether the chart is transparent and which GUI framework you are using?

Regards
Peter Kwan

  Re: Problems resizing XYChart
Posted by Ian Hammond on Jan-17-2018 20:08
Hi Peter,
Many thanks for your reply. I can confirm that I did set the chart background to transparent and that I am using mfc. I will look into your suggestions, thanks again.