Jump to content
Software FX Community

Re: Scatter charts and X-axis legends and more...

User (Legacy)

Recommended Posts

> 1) Then, instead of assigning *nRes = 1 you can do: 


> ChartFX1->ReturnValue = 1;


> This tells Chart FX that you have changed the string and its size will be

> recalculated.

This doesn't help (regardless of if I do it before or after changing hText).

Below is the full code:

STDMETHODIMP CChartWnd::XCfxEvents::Fire_GetAxisLabel(int nAxis)




CString strLabel;

if (nAxis == AXIS_X &&

pThis->m_pTable != NULL && pThis->m_pTool != NULL &&

pThis->m_pTool->m_nDstX != -1 &&

pThis->IsScatterType(-1) &&

pThis->m_pTable->GetColumnType(pThis->m_pTool->m_nDstX, TRUE) ==




char szBuffer[256];

LPSTR lpsz = szBuffer;

if (pThis->m_pChartFX->get_HText(&lpsz) == S_OK &&

VarR8FromStr(T2OLE(szBuffer), LOCALE_USER_DEFAULT, 0, &dbl) ==



COleDateTime dt((DATE)dbl);

if (pThis->m_pTool != NULL &&


strLabel = dt.Format(pThis->m_pTool->m_strDateFormat);


strLabel = dt.Format();

pThis->m_pChartFX->HText = (LPTSTR)(LPCTSTR)strLabel;

pThis->m_pChartFX->ReturnValue = 1;



return S_OK;


My system is Win2K, regional settings specify '.' (dot) as date delimiter,

',' (comma) - decimal point.

> 2) You must avoid calling SizeToFit before the chart has data and labels


> before the legend is displayed.

OK, I'll try.

Though IMHO it would be better if the library checks those error conditions

inside SizeToFit (it is you who know when it is dangerous to call a

function, users usually don't know all possible situations.) At least, it

should do nothing instead of crashing.

> 3) Check that thread. I answered it on 4/20/2000 after you sent me the


> on 4/18/00. Here is the answer in case you don't see it:


> You must make sure that the ScrollView limits match the step selected for


> particular axis. For instance if you have a step of 2 (your X-axis labels


> 2,4,6,8,...) you can not do a SetScrollView with odd numbers.

The clipping problem occurs even if I don't use SetScrollView. I checked

that under the debugger by commenting out all SetScrollView calls, the only

related call that I made during initialization is pXAxis->PixPerUnit = 0;

Also, I don't change the Step property. (Axis Properties dialog shows Major

Unit = Auto).

I thought that the purpose of SetScrollView is to specifiy how many points I

want to be displayed per one page. So if I call it to display 7 points and

the Step is Auto, then the number of bars displayed should be 7 (if total >=

7) and the number of major tick marks should be as appropriate depending on

lengths of the x-axis labels. Am I wrong?

Please look at the clip_line and clip_area gifs from my previous post. The

x-axis labels change by 1.

> 5) The GetTip event is only fired for the DataTip (automatic) for

> double-clicks there is another event (LButtonDblClk).


> 6) This titles can be accessed from the property pages (General and

> Axis-Labels) .You can also add your own dialog if you want.

Is it possible to add a new property page (tab) to the Chart FX Properties



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...