Frage zu CPlot



  • Kennt jemand das hier.
    http://cplot.sourceforge.net/

    Ich suche nach einer Möglichkeit, mehrere Linien in einem Graphen anzeigen zu lassen. Hab schon probiert, aber es wird nichts angezeigt. Vielleicht gibt es ja eine Alternative dazu(mit 3D Plot) für ohne GDI+.

    Für Anregungen bin ich dankbar

    double data[78];
    	int nDims,dims[3];
    	int dataID;
    	for(j=0;j<26;j++)
    	{
    		// x Data
    		data[j] = j - 26 / 2;
    		// y1 Data
    		data[j + 26] = data[j] * data[j];
    		// y2 Data
    		data[j + 2*26] = data[j];
    	}
    	nDims = 2;
    	dims[0] = 2;
    	dims[1] = 26;
    	dims[2] = 26;
    	dataID = m_Chart.AddData(data,nDims,dims);
    
    	//m_Chart.SetTitle("A parabola");
    	CAxis* x_axis;
    	CAxis* y_axis;
    	x_axis = m_Chart.AddAxis( kLocationLeft);
    	x_axis->SetTitle("y Value");
    	y_axis = m_Chart.AddAxis( kLocationBottom);
    	y_axis->SetTitle("x Value");
    
    	pDC->SetMapMode(MM_LOMETRIC);
    	pDC->DPtoLP( (LPPOINT) &rRTauG,2);
    
    	m_Chart.OnDraw(pDC,rRTauG);
    


  • Hast du schon das Tutorial zu CPlot versucht ?
    http://cplot.sourceforge.net/Tutorial/Tutorial.0index.htm
    ?



  • Sicher, ist ja fast daraus kopiert.
    Ist aber auch nur eine einzelne Funktion die angezeigt wird, deshalb hab mir gedacht:

    double data[78];
    	int nDims,dims[3];
    	int dataID;
    	for(j=0;j<26;j++)
    	{
    		// x Data
    		data[j] = j - 26 / 2;
    		// y1 Data
    		data[j + 26] = data[j] * data[j];
    		// y2 Data
    		data[j + 2*26] = data[j];
    	}
    	nDims = 3;
    	dims[0] = 3;
    	dims[1] = 26;
    	dims[2] = 26;
    	dataID = m_Chart.AddData(data,nDims,dims);
    
    	//m_Chart.SetTitle("A parabola");
    	CAxis* x_axis;
    	CAxis* y_axis;
    	x_axis = m_Chart.AddAxis( kLocationLeft);
    	x_axis->SetTitle("y Value");
    	y_axis = m_Chart.AddAxis( kLocationBottom);
    	y_axis->SetTitle("x Value");
    
    	pDC->SetMapMode(MM_LOMETRIC);
    	pDC->DPtoLP( (LPPOINT) &rRTauG,2);
    
    	m_Chart.OnDraw(pDC,rRTauG);
    

    Sollte eine Parabel und eine Gerade ergeben. Tut es aber nicht.


Anmelden zum Antworten