{
   //Draw a simple graph
   // To see the output of this macro, click begin_html <a href="gif/graph.gif">here</a>. end_html
   //Author: Rene Brun
   gROOT->Reset();
   TCanvas *c1 = new TCanvas("c1","JMeter Result",200,10,700,500);

   c1->SetFillColor(42);
   c1->SetGrid();

   ifstream ifile;
	Int_t num[501];//num
   Int_t data[501];//data
   Int_t avg[501];//avg
   Int_t med[501];//Median
   Int_t lt[501];//lt
   Int_t nlines = 0;
   ifile.open("jmeterresult.csv");
   while(1) {
	ifile >> num[nlines] >> data[nlines] >> avg[nlines] >> med[nlines] >> lt[nlines];
	nlines++;
	if(!ifile.good())
		break;
   }
   ifile.close();
   const Int_t n = 502;
   Int_t x[n], y[n];
   for (Int_t i=0;i<n;i++) {
     x[i] = i;
     y[i] = data[i];
     printf(" i %i %d %d \n",i,x[i],y[i]);
   }
   gr = new TGraph(n,x,y);
   gr->SetLineColor(1);
   gr->SetLineWidth(1);
   gr->SetMarkerColor(4);
   gr->SetMarkerStyle(21);
   gr->SetTitle("JMeter Test Report");
   gr->GetXaxis()->SetTitle("data");
   gr->GetYaxis()->SetTitle("time[ms]");
   gr->Draw("AL");
   TF1 f1("f1", "pol1");
	f1.SetLineWidth(2);
	f1.SetLineColor(2);
	//f1.SetParameters(2.437,-0.367,0.001);
	gr.Fit("f1");

   // TCanvas::Update() draws the frame, after which one can change it
   c1->Update();
   c1->GetFrame()->SetFillColor(21);
   c1->GetFrame()->SetBorderSize(12);
   c1->Modified();

   /* 
Minimizer is Linear
Chi2                      =     1.56653e+007
NDf                       =     132
Par_0                     =     627.135         +/-     87.6463
Par_1                     =     4.76514         +/-     3.02247
Par_2                     =     0.057407        +/-     0.0218295
	*/ 
}

