ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Draw LEGEND to charts
Posted by thomas on Feb-01-2012 03:56
(i make it in C++ (dev-c++), win XP)

hello when i draw legend for charts by :

c->addAreaLayer(DoubleArray(data1, sizeof(data1)/sizeof(data1[0])), 0x80cc6666,
        "something");

How can i replace static word "SOMETHING" ??? i want give here array with my word

please help , when i only write simple name of array it gets erro


for example i firs input from keyboard and save to string array and then load to my legent:

...
...
...
string POPIS1;
cout << "please write description of first axis : ";
getline (cin, POPIS1);

string POPIS2;
cout << "please write description of second axis : ";
getline (cin, POPIS2);

...
...
...

c->addAreaLayer(DoubleArray(data0, sizeof(data0)/sizeof(data0[0])), 0x806666cc,
        "POPIS1");
..
..
c->addAreaLayer(DoubleArray(data1, sizeof(data1)/sizeof(data1[0])), 0x80cc6666,
        "POPIS2");
...

  Re: Draw LEGEND to charts
Posted by Peter Kwan on Feb-02-2012 01:25
Hi thomas,

If you are using use STL "string" as the text string, please obtain the C text string "char *" using c_str. For example:

c->addAreaLayer(DoubleArray(data0, sizeof(data0)/sizeof(data0[0])), 0x806666cc,
        POPIS1.c_str());

You may refer to your STL "string" documentation for more details on its c_str method. This method is used to obtain a C text string from an STL text string.

Hope this can help.

Regards
Peter Kwan

  Re: Draw LEGEND to charts
Posted by thomas on Feb-02-2012 05:20
thanks, it works
have nice day