URGENT: Setting the Data property of VtChart

URGENT: Setting the Data property of VtChart

Post by David Veal » Sat, 31 Mar 2001 13:22:33



I'm trying to use the VtChart control that came with C++Builder 5.  I can't
figure out how to set the Data property via code.  I want to have 4 columns
of data in a 3D pie chart.  I've figured out that I can't simply assign
integers to the Data property for the values -- the values need to first be
converted to some kind of string.  I can't figure it out, the docs are
useless, and my deadline is fast approaching.

Does someone have the correct syntax to assign values to VtChart->Data?

 
 
 

URGENT: Setting the Data property of VtChart

Post by Team » Wed, 04 Apr 2001 12:53:17


Hi David,

Quote:> I want to have 4 columns of data in a 3D pie chart.  I've figured
> out that I can't simply assign integers to the Data property for
> the values -- the values need to first be converted to some kind
> of string.

I've never used the VtChart component before, but from my simple
experiments, and from looking at the header file (vcfi.hpp), the Data
property expects and returns a value of type WideString.  And, because
the WideString class has a constructor that accepts an AnsiString-type
value...

   __fastcall WideString(const AnsiString& src);

...you can use the IntToStr() VCL function to set the Chart's Data
property.  

Here's an example...

__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
   VtChart1->RowCount = 1;
   VtChart1->ColumnCount = 4;  
   VtChart1->ChartType = VtChChartType3dPie;

Quote:}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
   VtChart1->Row = 1;

   // set the data for the first slice  
   VtChart1->Column = 1;
   VtChart1->ColumnLabel = "This slice shows 10%--i.e., 25/250";
   VtChart1->Data = IntToStr(25);

   // set the data for the second slice
   VtChart1->Column = 2;
   VtChart1->ColumnLabel = "This slice shows 20%--i.e., 50/250";
   VtChart1->Data = IntToStr(50);

   // set the data for the third slice
   VtChart1->Column = 3;
   VtChart1->ColumnLabel = "This slice shows 30%--i.e., 75/250";  
   VtChart1->Data = IntToStr(75);

   // set the data for the fourth slice
   VtChart1->Column = 4;
   VtChart1->ColumnLabel = "This slice shows 40%--i.e., 100/250";  
   VtChart1->Data = IntToStr(100);

Quote:}

HTH,
--
Damon Chandler (TeamB)
- BCBCAQ <http://bcbcaq.freeservers.com>
- Graphics API Black Book <http://graphicsBB.itgo.com>

 
 
 

1. Setting the Data property of VtChart

I'm trying to use the VtChart control that came with C++Builder 5.  I can't
figure out how to set the Data property via code.  I want to have 4 columns
of data in a 3D pie chart.  I've figured out that I can't simply assign
integers to the Data property for the values -- the values need to first be
converted to some kind of string.  I can't figure it out.  Does someone have
the correct syntax to assign values to Data?

2. Volume Rendering Q: methods, code, apps etc

3. Material (color) properties data set?

4. IPAS for lightspeed effect?

5. *** URGENT URGENT URGENT URGENT URGENT URGENT URGENT URGENT ***

6. hello

7. *** URGENT URGENT URGENT URGENT URGENT ***

8. Need urgent with filename property of TMediaPlayer!

9. print two set of data from same data file

10. set size for data sets

11. plotting multiple graph from nultiple data set within one data file

12. Help Setting Lighting and Material Properties