Click here to Skip to main content
16,011,482 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC++ XML integration Pin
Nemanja Trifunovic5-Jun-02 7:48
Nemanja Trifunovic5-Jun-02 7:48 
GeneralError when using EnumObjects function. Pin
redeemer5-Jun-02 7:16
redeemer5-Jun-02 7:16 
GeneralRe: Error when using EnumObjects function. Pin
Cathy6-Jun-02 9:43
Cathy6-Jun-02 9:43 
GeneralMSChart labels Pin
5-Jun-02 5:50
suss5-Jun-02 5:50 
GeneralRe: MSChart labels Pin
Richard Ellis5-Jun-02 20:36
Richard Ellis5-Jun-02 20:36 
GeneralRe: MSChart labels Pin
Ruca20-Aug-02 1:08
Ruca20-Aug-02 1:08 
GeneralRe: MSChart labels Pin
Ruca20-Aug-02 5:28
Ruca20-Aug-02 5:28 
GeneralRe: MSChart labels Pin
Ruca20-Aug-02 6:43
Ruca20-Aug-02 6:43 
hi Richard,

The following works:

COleSafeArray saRet;
CString strLabel = "";

DWORD numElements[] = {10, 1}; // 10x10
//DWORD numElements[] = {10};

// Create the safe-array...
saRet.Create(VT_R8, 2, numElements);

// Initialize it with values...

long index[2];

for(index[0] = 0; index[0] < 10; index[0]++)
{
for(index[1] = 0; index[1] < 1; index[1]++)
{
double val = index[0]*10;
saRet.PutElement(index, &val);
}
}

// Return the safe-array encapsulated in a VARIANT...
m_Chart.SetChartData(saRet.Detach());
m_Chart.SetChartType(3);

CVcPlot Plot = m_Chart.GetPlot();
CVcSeriesCollection SeriesCollection = Plot.GetSeriesCollection();

CVcSeries Series = SeriesCollection.GetItem(1);
Series.SetLegendText(_T("New Text"));



CVcDataGrid DataGrid = m_Chart.GetDataGrid();

short i;
short nRows = DataGrid.GetRowLabelCount();
short nColumns = DataGrid.GetColumnLabelCount();

/* for (i=0; i {
strLabel.Format("col %d", i);
DataGrid.SetColumnLabel(i, 1, strLabel);
}
*/

short j;
// DataGrid.SetColumnLabelCount(10);
// count = DataGrid.GetColumnLabelCount();
for ( i = 1; i < 6; i++ )
{
//strLabel.Format("row %d", i);
strLabel = "Row Text";
j = i * 2;
// DataGrid.SetColumnLabel(j, 1, strLabel);
strLabel = DataGrid.GetColumnLabel(j, 1);
//AfxMessageBox(strLabel);
DataGrid.SetRowLabel(i, 1, "Row");
strLabel = DataGrid.GetRowLabel(i, 1);
}

m_Chart.SetShowLegend(TRUE);

m_Chart.Refresh();



Try it.

Thanks for your help

Rui
GeneralRe: MSChart labels Pin
Richard Ellis20-Aug-02 13:20
Richard Ellis20-Aug-02 13:20 
QuestionIs there an ActiveX Control like Favorites? Pin
Dov Sherman5-Jun-02 5:01
Dov Sherman5-Jun-02 5:01 
AnswerRe: Is there an ActiveX Control like Favorites? Pin
Tomasz Sowinski5-Jun-02 5:08
Tomasz Sowinski5-Jun-02 5:08 
GeneralRe: Is there an ActiveX Control like Favorites? Pin
Dov Sherman5-Jun-02 5:51
Dov Sherman5-Jun-02 5:51 
GeneralRe: Is there an ActiveX Control like Favorites? Pin
Tomasz Sowinski5-Jun-02 5:53
Tomasz Sowinski5-Jun-02 5:53 
GeneralRe: Is there an ActiveX Control like Favorites? Pin
Dov Sherman5-Jun-02 6:52
Dov Sherman5-Jun-02 6:52 
GeneralHelp!! Pin
chaolong5-Jun-02 4:37
chaolong5-Jun-02 4:37 
GeneralRe: Help!! Pin
Michael P Butler5-Jun-02 5:00
Michael P Butler5-Jun-02 5:00 
GeneralRe: Help!! Pin
chaolong5-Jun-02 4:59
chaolong5-Jun-02 4:59 
GeneralRe: Help!! Pin
Rage5-Jun-02 5:23
professionalRage5-Jun-02 5:23 
GeneralProblem with Creation Pin
Big B5-Jun-02 4:19
Big B5-Jun-02 4:19 
GeneralRe: Problem with Creation Pin
Tomasz Sowinski5-Jun-02 4:36
Tomasz Sowinski5-Jun-02 4:36 
GeneralRe: Problem with Creation Pin
Big B5-Jun-02 4:41
Big B5-Jun-02 4:41 
GeneralRe: Problem with Creation Pin
Tomasz Sowinski5-Jun-02 4:50
Tomasz Sowinski5-Jun-02 4:50 
GeneralRe: Problem with Creation Pin
Big B5-Jun-02 5:17
Big B5-Jun-02 5:17 
GeneralInteresting Remark in the MSDN Library... For CreateFile(...) Pin
James R. Twine5-Jun-02 3:41
James R. Twine5-Jun-02 3:41 
GeneralRe: Interesting Remark in the MSDN Library... For CreateFile(...) Pin
Tomasz Sowinski5-Jun-02 4:06
Tomasz Sowinski5-Jun-02 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.