A
antarikshv
Hi,
Can any one please help me in creating chart in VC++ .net 2005 and
Excel 2003.
I am stuck at the point when i want to give a specific column as the X-
axis and a specific column as Y-axis. currently i am able to specify a
range and draw the chart. If you could give the code then it will be
the best thing. the following is the code i am referring to.
// The following code draws the chart
Excel::ChartObjects^ chartobjects =
safe_cast<Excel::ChartObjects^>(worksheet->ChartObjects(oMissing));
Excel::ChartObject^ chartobject =
safe_cast<Excel::ChartObject^>(chartobjects->Add(10 /*Left*/, 100 /
*Top*/, 450 /*Width*/, 250 /*Height*/));
// Call to chart.ChartWizard() is shown using late binding
technique solely for the demonstration purposes
array<Object^>^ args7 = gcnew array<Object^>(11);
args7[0] = ran; // Source
args7[1] = Excel::XlChartType::xlLineMarkers; // Gallery - note,
we're using implicit boxing here
args7[2] = oMissing; // Format
args7[3] = Excel::XlRowCol::xlRows; // PlotBy - note, we're using
implicit boxing here
args7[4] = nullptr; // CategoryLabels
args7[5] = nullptr; // SeriesLabels
args7[6] = true; // HasLegend - note, we're using implicit boxing
here
args7[7] = "Sample Chart"; // Title
args7[8] = "Sample Category Type"; // CategoryTitle
args7[9] = "Sample Value Type"; // ValueTitle
args7[10] = oMissing; // ExtraTitle
// The last parameter is lcid, but as we use late binding here it
should be omited
//args7[11] = 0; // lcid
chart->GetType()->InvokeMember("ChartWizard",
System::Reflection::BindingFlags::InvokeMethod, nullptr, chart,
args7);
Also i am unaware of late bindings. Can anyone help with what it means
and what effect does it have on performance.
Can any one please help me in creating chart in VC++ .net 2005 and
Excel 2003.
I am stuck at the point when i want to give a specific column as the X-
axis and a specific column as Y-axis. currently i am able to specify a
range and draw the chart. If you could give the code then it will be
the best thing. the following is the code i am referring to.
// The following code draws the chart
Excel::ChartObjects^ chartobjects =
safe_cast<Excel::ChartObjects^>(worksheet->ChartObjects(oMissing));
Excel::ChartObject^ chartobject =
safe_cast<Excel::ChartObject^>(chartobjects->Add(10 /*Left*/, 100 /
*Top*/, 450 /*Width*/, 250 /*Height*/));
Excel::_Chart^ chart = safe_cast said:Chart);
// Call to chart.ChartWizard() is shown using late binding
technique solely for the demonstration purposes
array<Object^>^ args7 = gcnew array<Object^>(11);
args7[0] = ran; // Source
args7[1] = Excel::XlChartType::xlLineMarkers; // Gallery - note,
we're using implicit boxing here
args7[2] = oMissing; // Format
args7[3] = Excel::XlRowCol::xlRows; // PlotBy - note, we're using
implicit boxing here
args7[4] = nullptr; // CategoryLabels
args7[5] = nullptr; // SeriesLabels
args7[6] = true; // HasLegend - note, we're using implicit boxing
here
args7[7] = "Sample Chart"; // Title
args7[8] = "Sample Category Type"; // CategoryTitle
args7[9] = "Sample Value Type"; // ValueTitle
args7[10] = oMissing; // ExtraTitle
// The last parameter is lcid, but as we use late binding here it
should be omited
//args7[11] = 0; // lcid
chart->GetType()->InvokeMember("ChartWizard",
System::Reflection::BindingFlags::InvokeMethod, nullptr, chart,
args7);
Also i am unaware of late bindings. Can anyone help with what it means
and what effect does it have on performance.