User (Legacy) Posted April 18, 2002 Report Share Posted April 18, 2002 Hi I am trying to use Export(CHART_BITMAP, filename) to save a file , but the file is zero bytes. There is no window associated, I just want to set the attributes and export the graph to a bitmap. Can u please provide me a sample or the steps to get this working. Here are the steps I followed m_pChartFX.CreateInstance(__uuidof(ChartFX)); m_pChartFX->ClearData(CD_STRINGS); //in general to remove different settings per series in the other charts m_pChartFX->ClearData(CD_PERSERIESATTRIBUTES); //in general to remove tools like dataeditor, legend boxes set in other charts m_pChartFX->ClearData(CD_TOOLS); //to remove the stripes set in the scatter chart m_pChartFX->ClearData(CD_STRIPES); //set Orientation to LANDSCAPE m_pChartFX->Printer->Orientation = ORIENTATION_LANDSCAPE; //LANDSCAPE; ICfxAxisPtr pAxis; pAxis = m_pChartFX->Axis->Item[AXIS_X]; pAxis->AdjustScale(); m_pChartFX->MultipleColors = TRUE; m_pChartFX->Gallery = (CfxGallery)BAR; m_pChartFX->Chart3D = FALSE; m_pChartFX->OpenDataEx((CfxCod) (COD_VALUES|COD_REMOVE), 1, 10); for (int i=0; i < (iRows-1); i++) { m_pChartFX->ValueEx[0][i] = 10.00; m_pChartFX->Legend[i] = "Text"; } m_pChartFX->CloseData(COD_VALUES); m_pChartFX->LegendBox = FALSE; m_pChartFX->Axis->Item[AXIS_X]->LabelAngle = 90; m_pChartFX->Refresh(); m_pChartFX->EXPORT(CHART_BITMAP,filename); Thanks Indhu Quote Link to comment Share on other sites More sharing options...
Software FX Posted April 22, 2002 Report Share Posted April 22, 2002 The chart needs to have a size in order to be exported. If you are using the DLL, a window HAS to be created even if it is invisible. If you are using the OCX, then you don't need to create a window but you do need to assign a size to the control. -- FP Software FX, Inc. Quote Link to comment Share on other sites More sharing options...
User (Legacy) Posted April 22, 2002 Author Report Share Posted April 22, 2002 Thanks I am using the OCX. but I could not find a property to set the size. Can you tell what property that is Thanks Indhu "SoftwareFX Support" <support@softwarefx.com> wrote in message news:vmqs7Eh6BHA.1484@webserver1.softwarefx.com... > The chart needs to have a size in order to be exported. > > If you are using the DLL, a window HAS to be created even if it is > invisible. > > If you are using the OCX, then you don't need to create a window but you do > need to assign a size to the control. > > -- > FP > Software FX, Inc. > > Quote Link to comment Share on other sites More sharing options...
Software FX Posted April 22, 2002 Report Share Posted April 22, 2002 In an OCX, the Size is a property that the container provides not the control itself. The CreateControl function in MFC will assign this size for you but it will also Activate it hence creating a window. To assign a size without creating a window, you can use IOleObject::SetExtent See documentation on IOleObject for details. -- FP Software FX, Inc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.