OneColorGradient

G

Guest

hi all,

i have an app that exports excel graphs using "#import excel.h" directive,
now i'm converting the app to use a automation class generated by Microsoft
Studio 6.0 Class Wizard( that has all modules/properties ).

I'm having some trouble converting the line:
series->Fill->OneColorGradient( Office::msoGradientHorizontal, 4, 0.25 );

i have converted to:

#define CovOptionalParam COleVariant((long)DISP_E_PARAMNOTFOUND, VT_ERROR)

SeriesCollection series_collection =
wrkChart.SeriesCollection(CovOptionalParam);
int nSeries = series_collection.GetCount();
for( int iSeries=0; iSeries<nSeries; ++iSeries )
{
Series series_obj = series_collection.Item( _variant_t((short)(iSeries +
1)) );

FillFormat fill_format = series.GetFill();
fill_format.OneColorGradient( msoGradientHorizontal, 4, 0.25 );
}

but it does not work an exception is raised, any ideas?

thanks for all the help
Jose Valente
 
G

Guest

solved ;)

using ITypeInfo methods over the GetFill() return interface LPDISPATCH,
i realize that a Series object does not returns an FillFormat interface but
instead it returns an ChartFillFormat:

ChartFillFormat f = series_obj.GetFill();
f.OneColorGradient( msoGradientHorizontal, 4, 0.25 );

does the trick ;)

thanks anyway for all the help
Jose Valente
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top