|
Can't get addExtraField2 to work |
Posted by Chuck Willette on Apr-20-2013 23:29 |
|
Peter,
I am trying to include a label (lamp number) along with the xy coordinates of each point of
a line chart, but I am unable to get addExtraField2 to work. I get the error message "Class
LineLayer has no member addExtraField2". I admit to being a poor C++ programmer so
any help here would be appreciated. Thanks
LineLayer *layer1 = c->addLineLayer(DoubleArray(ycoord,
sizeof(ycoord)/sizeof(ycoord[0])), 0xff3333);
layer1->setXData(DoubleArray(xcoord, sizeof(xcoord)/sizeof(xcoord[0])));
//put x,y coordinates at each lamp endpoint
char xlabel[4];
index = 0;
int coord_color =0;
layer1->addExtraField2(lnum);
for (int ln=1; ln<=num_lamps; ln++) {
// alternate the color of the coordinates from black to red to be able to
distinguish overlapped lamps on the placement diagram
if (ln % 2 == 0) coord_color = -35000;
else coord_color = 0;
_itoa_s (USlampx1[ln], xlabel, 10);
layer1->addCustomDataLabel(0, index, "({field0}: {x}, {value})",
"arialbd.ttf", 8, coord_color, 90);
_itoa_s (USlampx2[ln], xlabel, 10);
layer1->addCustomDataLabel(0, index+1, "({field0}: {x}, {value})",
"arialbd.ttf", 8, coord_color, 90);
index+=3;
} |
Re: Can't get addExtraField2 to work |
Posted by Peter Kwan on Apr-22-2013 18:47 |
|
Hi Chuck,
Sorry for the confusion documentation. In C++, the method is addExtraField, not addExtraField2.
http://www.advsofteng.com/doc/cdcpp.htm#Layer.addExtraField2.htm
Whereas the title of the page mentions BaseChart.addExtraField2, you may notice in the "Usage" section that the method should be used as addExtraField. The page title is merely for indexing and unique identification of the page. The actual usage is in the "Usage" section of the documentation.
Hope this can help.
Regards
Peter Kwan |
|