Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with TChart Component

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In C++ Builder I made a project that makes a connection between a TDBChart and a Stored Procedure. Everything works fine, it shows the result perfectly in the TDBChart.
Now I've added the option to change the serie that is shown. There are radio buttons where you can select which one you want to see. Here's one example :

void __fastcall TFMain::rbAreaClick(TObject *Sender)
{
this->MakeSerie(new TAreaSeries(DBChart), DBChart);
}

void __fastcall TFMain::MakeSerie(TChartSeries *Serie, TDBChart *Chart)
{
Serie->ParentChart = Chart;
Serie->DataSource = ADOStoredProc;
Serie->YValues->ValueSource = "ReservationCount";
Serie->XValues->ValueSource = "ClientID";
Serie->XLabelsSource = "ClientName";
Serie->Marks->Style = smsPercent;
Serie->ColorEachPoint = true;

Chart->RemoveAllSeries();
Chart->AddSeries(Serie);
}

It hasn't been finetuned yet, but it does what it's supposed to do at this moment.

Only thing is : when I change to a Pie Serie and then back to for example a Bar Serie, all my Axis, Grids, etc. are gone. I've tried enabling some things :

Chart->View3DWalls = true;
Chart->AxisVisible = true;
Chart->View3D = true;

But still it isn't like it should be shown, like it is when I first create it with a Bar Serie.

Anyone know I should do to get the right views back? When I change to a Pie Serie, something happens, but I have no idea what it is. I hope I explained it well enough, if there are any questions, feel free to ask...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top