
/*

Sample program for charts

*/


#include"gui/chart.h"
#include"ui/dialog.h"


#define ID_CH 300


class RootChart : public UI_Dialog
{
  public:

	RootChart() : UI_Dialog(NULL,0,UI_Rectangle(50, 50, 700, 600))
	{
	  Title() = "Test the charts";

	  c1 = new Chart(this,UI_Rectangle(10,10,300,300),ID_CH+1);
	  c2 = new Chart(this,UI_Rectangle(320,10,300,300),ID_CH+2);

	  c1->cnvX().initialize(2,0,'.',FALSE);
	  c1->cnvY().initialize(2,0,'.',FALSE);
	  c2->cnvX().initialize(2,0,'.',FALSE);
	  c2->cnvY().initialize(3,2,'.',FALSE);
	  c1->Title() = "Linear";
	  c2->Title() = "Gradual";
	  c1->dscX()->Title() = "x";
	  c1->dscY()->Title() = "f(x)";
	  c2->dscX()->Title() = "Year";
	  c2->dscY()->Title() = "$";
	  c2->set_Style(GRADUAL);

	  c1->values().Add(CL_Pair(0,0));
	  c1->values().Add(CL_Pair(5,10));
	  c1->values().Add(CL_Pair(2,50));
	  c1->values().Add(CL_Pair(8,20));
	  c1->values().Add(CL_Pair(3,80));

	  c2->values().Add(CL_Pair(93,10));
	  c2->values().Add(CL_Pair(94,20));
	  c2->values().Add(CL_Pair(95,30));
	  c2->values().Add(CL_Pair(96,80));
	  c2->values().Add(CL_Pair(90,0));
	};

  protected:

	 Chart* c1;
	 Chart* c2;
};
