Click here to Skip to main content
15,902,765 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: save result in xml vc++2005 Pin
lavy288311-May-07 7:37
lavy288311-May-07 7:37 
QuestionLoad txt file from resource and passing to a stream Pin
alexproject11-May-07 7:02
alexproject11-May-07 7:02 
AnswerRe: Load txt file from resource and passing to a stream Pin
Mark Salsbery11-May-07 7:43
Mark Salsbery11-May-07 7:43 
QuestionRe: Load txt file from resource and passing to a stream Pin
alexproject11-May-07 12:53
alexproject11-May-07 12:53 
AnswerRe: Load txt file from resource and passing to a stream Pin
Mark Salsbery11-May-07 13:04
Mark Salsbery11-May-07 13:04 
QuestionDisplay 2 D plot Pin
gauravsaxena_1911-May-07 6:58
gauravsaxena_1911-May-07 6:58 
AnswerRe: Display 2 D plot Pin
Cedric Moonen11-May-07 7:28
Cedric Moonen11-May-07 7:28 
GeneralRe: Display 2 D plot Pin
gauravsaxena_1914-May-07 7:24
gauravsaxena_1914-May-07 7:24 
I am using Microsoft Visual c++ 6.0. I have a dialog based MFC application, here I have a button 'Plot'. On Click Plot, I have placed the code that is given in the tutorial.


The result that I see is - Title is addded, background color has been changed, but it does not plot the data.

void CCharttutorialDlg::OnPlot()
{
// TODO: Add your control notification handler code here

double X[361];
double Y[361];

CChartSerie *pLineSerie = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);

for (int i = 0; i < 361; i++)
{
X[i] = 10 * sin(i/360 * 2 * 3.141592);
Y[i] = 10 * cos( (i-60)/360 * 2 * 3.141592);

}

pLineSerie->SetPoints(X, Y, 361);

COLORREF TextColor = RGB(0,180,0);
COLORREF BackColor = RGB(0,50,0);
COLORREF GridColor = RGB(0,180,0);
COLORREF SerieColor = RGB(0,255,0);

m_ChartCtrl.SetEdgeType(EDGE_SUNKEN);


m_ChartCtrl.SetBorderColor(TextColor);
m_ChartCtrl.SetBackColor(BackColor);

m_ChartCtrl.GetBottomAxis()->SetMinMax(-15,15);
m_ChartCtrl.GetLeftAxis()->SetMinMax(-15,15);

m_ChartCtrl.GetBottomAxis()->SetColor(TextColor);
m_ChartCtrl.GetBottomAxis()->SetTextColor(TextColor);
m_ChartCtrl.GetBottomAxis()->GetGrid()->SetColor(GridColor);


m_ChartCtrl.GetLeftAxis()->SetColor(TextColor);
m_ChartCtrl.GetLeftAxis()->SetTextColor(TextColor);
m_ChartCtrl.GetLeftAxis()->GetGrid()->SetColor(GridColor);


m_ChartCtrl.GetTitle()->SetColor(TextColor);
m_ChartCtrl.GetTitle()->SetFont(140, "Times NewRoman");
m_ChartCtrl.GetTitle()->AddString("An example of Plot tutorial");

pLineSerie->SetColor(SerieColor);
m_ChartCtrl.RefreshCtrl();



}

Gaurav
GeneralRe: Display 2 D plot Pin
Cedric Moonen14-May-07 7:37
Cedric Moonen14-May-07 7:37 
GeneralRe: Display 2 D plot Pin
gauravsaxena_1914-May-07 8:53
gauravsaxena_1914-May-07 8:53 
QuestionMouseover Pin
prathuraj11-May-07 6:35
prathuraj11-May-07 6:35 
AnswerRe: Mouseover Pin
Mark Salsbery11-May-07 7:04
Mark Salsbery11-May-07 7:04 
AnswerRe: Mouseover Pin
Nelek13-May-07 20:27
protectorNelek13-May-07 20:27 
QuestionStrange message during serialization. please help! Pin
Arris7411-May-07 6:17
Arris7411-May-07 6:17 
QuestionRe: Strange message during serialization. please help! Pin
Mark Salsbery11-May-07 6:28
Mark Salsbery11-May-07 6:28 
AnswerRe: Strange message during serialization. please help! Pin
Arris7411-May-07 8:56
Arris7411-May-07 8:56 
GeneralRe: Strange message during serialization. please help! Pin
Mark Salsbery11-May-07 9:55
Mark Salsbery11-May-07 9:55 
GeneralRe: Strange message during serialization. please help! Pin
Arris7411-May-07 10:59
Arris7411-May-07 10:59 
QuestionRe: Strange message during serialization. please help! Pin
Mark Salsbery11-May-07 11:14
Mark Salsbery11-May-07 11:14 
AnswerRe: Strange message during serialization. please help! Pin
Arris7411-May-07 11:54
Arris7411-May-07 11:54 
GeneralRe: Strange message during serialization. please help! Pin
Mark Salsbery11-May-07 12:19
Mark Salsbery11-May-07 12:19 
QuestionNo Windows xp visual styles in VC++ 2003 Pin
johnny__XP11-May-07 6:06
johnny__XP11-May-07 6:06 
AnswerRe: No Windows xp visual styles in VC++ 2003 Pin
Mark Salsbery11-May-07 6:22
Mark Salsbery11-May-07 6:22 
QuestionBreaking out of a blocking function...[Threads] Pin
Eytukan11-May-07 5:23
Eytukan11-May-07 5:23 
AnswerRe: Breaking out of a blocking function...[Threads] Pin
CPallini11-May-07 5:34
mveCPallini11-May-07 5:34 

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.