S
Sascha Sertel
If there was an OWC magazine, I would probably write the Ranting article for
every issue. So here is my latest tidbit:
Since I couldn't find anyone complaining about positioning data labels in
the last 500 posts, I thought it would be time to bring this up again. Here
I was sitting, using the simplest form of all charts, the Pie Chart, until
reality hit me hard again. Despite the things I had experienced before, I
was still a strong believer in following the documentation. If we look on
the page with the Position Property description, especially the part for the
ChDataLabels object, we find that the values from the
ChartDataLabelPositionEnum can be used to position the data labels. Great, I
thought, since I need to position my data labels in the pie chart outside of
the pie segments.
But then the unthinkable happened. Upon using the chLabelPositionOutsideEnd
constant from the enumeration, I got an invalid parameter error. While
chLabelPositionAutomatic and chLabelPositionCenter both worked fine, well
actually they do exactly the same, none of the other 8 (!!!) constants
worked. One Google later, Thao Moua brought the answer. Let me quote again:
"Data label positioning in Excel Chart and OWC Chart are different. In OWC
Chart we only support automatic which is the same as center whereas in Excel
Chart there are more options. If you want to draw your own data labels in
OWC Chart, you should use custom drawing. Search for 'custom drawing' in the
Help file for more info."
This nice little statement would have been very helpful, if they had been
included it in the documentation! I said it before, I'll repeat it once
more: Why don't they include these known limitations or missing
implementation pieces in the documentation, so that people are at least
aware of this? Fine, having to use the AfterRender event to place text with
the DrawText method outside of the pie to emulate outside data labels is not
very elegant, but at least it works (more or less). Or if as said above you
only support certain constants, then don't put the other constants in the
object, or mark them as not implemented etc. There are lots of ways to save
the developer the time he needs to figure out by himself why things don't
work as stated in the documentation.
Cya in the next issue ;-)
Sascha
every issue. So here is my latest tidbit:
Since I couldn't find anyone complaining about positioning data labels in
the last 500 posts, I thought it would be time to bring this up again. Here
I was sitting, using the simplest form of all charts, the Pie Chart, until
reality hit me hard again. Despite the things I had experienced before, I
was still a strong believer in following the documentation. If we look on
the page with the Position Property description, especially the part for the
ChDataLabels object, we find that the values from the
ChartDataLabelPositionEnum can be used to position the data labels. Great, I
thought, since I need to position my data labels in the pie chart outside of
the pie segments.
But then the unthinkable happened. Upon using the chLabelPositionOutsideEnd
constant from the enumeration, I got an invalid parameter error. While
chLabelPositionAutomatic and chLabelPositionCenter both worked fine, well
actually they do exactly the same, none of the other 8 (!!!) constants
worked. One Google later, Thao Moua brought the answer. Let me quote again:
"Data label positioning in Excel Chart and OWC Chart are different. In OWC
Chart we only support automatic which is the same as center whereas in Excel
Chart there are more options. If you want to draw your own data labels in
OWC Chart, you should use custom drawing. Search for 'custom drawing' in the
Help file for more info."
This nice little statement would have been very helpful, if they had been
included it in the documentation! I said it before, I'll repeat it once
more: Why don't they include these known limitations or missing
implementation pieces in the documentation, so that people are at least
aware of this? Fine, having to use the AfterRender event to place text with
the DrawText method outside of the pie to emulate outside data labels is not
very elegant, but at least it works (more or less). Or if as said above you
only support certain constants, then don't put the other constants in the
object, or mark them as not implemented etc. There are lots of ways to save
the developer the time he needs to figure out by himself why things don't
work as stated in the documentation.
Cya in the next issue ;-)
Sascha