Click here to Skip to main content
15,885,810 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to use the co-ordinate array from richtextbox and use for plot a graph in c++/cli. but i have a problem to convert cli::array<double>^ x to const double* data.please help me.

What I have tried:

cli::array<String^>^ x = richTextBox5->Lines;
cli::array<String^>^ y = richTextBox3->Lines;
Converter<String^, double>^ converter = gcnew Converter<String^, double>(double::Parse);
cli::array<double>^ SortY = Array::ConvertAll(y, converter);
cli::array<double>^ SortX = Array::ConvertAll(x, converter);
for (int i = 0; i < richTextBox5->Lines->Length; i++)

		{double* arrx = new double[richTextBox5->Lines->Length]{ SortX[i] };
		 double* arry = new double[richTextBox3->Lines->Length]{ SortY[i] };
		for (int i = 0; i < richTextBox5->Lines->Length; i++) 
{
				arrx[i] =  SortX[i];
				arry[i] = SortY[i];
//for plot i use chardir library.
c->addScatterLayer(DoubleArray(arrx, richTextBox5->Lines->Length), DoubleArray(arry, richTextBox3->Lines->Length),"", Chart::DiamondSymbol, 13, 0xff9933);
c->makeChart("scatter1.png");
Posted
Updated 27-Oct-21 18:07pm
v2
Comments
Richard MacCutchan 28-Oct-21 4:28am    
"but i have a problem"
And like far too many people here, you do not tell us what the problem is.
n.deny 28-Oct-21 20:14pm    
scatter1.png only plot the first value of arrx and arry not the whole array. i need to plot whole array.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900