|
PieChart label text formatting |
Posted by AP on May-02-2006 05:34 |
|
Hello,
We are using Chartdirector and our graph looks something like the one attached here.
I would like to know in chartdirector if there a way, we can do a word wrap to next line for the labels that are too big.
Like in the example shown below can we make the label "Plan & Direct Credit (Fixed) 0.23 %" span over 2 lines ? . we do not want to reduce the font.
|
Re: PieChart label text formatting |
Posted by Peter Kwan on May-02-2006 06:03 |
|
Hi AP,
I think in ChartDirector Ver 4.0 or above, it should automatically wrap the labels in the legend box. You may also explicitly specify a maximum length using the TextBox.setMaxWidth API. If the text is longer than this width, it will be wrapped into multiple lines.
For example (in VB/VBScript):
'Create legend box as usual
Set legendBox = c.addLegend(.............)
'Wrap if longer than 200 pixels
Call legendBox.setMaxWidth(200)
(From the graphics in your attached chart, it seems you are using an earlier version of ChartDirector, in which setMaxWidth is not yet supported. You may consider to upgrade to the latest version. If your ChartDirector license is purchased on or after Apr 2003, then upgrading to Ver 4.0 is free of charge.)
Regards
Peter Kwan |
Re: PieChart label text formatting |
Posted by Karthick raj on Jul-31-2013 20:11 |
|
SetMaxWidth its working |
Re: PieChart label text formatting |
Posted by AP on May-05-2006 23:29 |
|
Thank you for your quick response on this issue the same day ! It is very impressive.
Further I tried to download Version 4.0 for .NET. I added a reference to Netchartdir.dll in my solution file. but it did not find the method "SetMaxwidth" but found other methods like Setmargins.
any suggestions ?
Our company does have currently 3.1 version that was purchased after April '2003.
Thanks. |
Re: PieChart label text formatting |
Posted by Peter Kwan on May-06-2006 02:00 |
|
Hi AP,
I think we should first confirmed that you are in fact using Ver 4.0. In Ver 4.0, each color box of the legend keys should have a black border. I have attached an example for your reference. You may look at your charts to see if there are black borders around the color boxes.
One of the features of .NET is that it allows multiple versions of the same DLL to co-exists. (This is advertise my Microsoft as a means to solve the "DLL Hell" problem.) However, it means installing a new DLL does not automatically deactivate the old DLL. It all depends on your system configuration.
Also, the DLL referenced in your project is only used in compilation. It may not be the same DLL used in running the program. For example, in a web application, the web.config (or the global machine.config) may insist on using the old version of the DLL installed in GAC.
It may also be useful to right click on the DLL, and choose "Properties" to ensure it is of Ver 4.0.7.0.
If you are in fact using the new version of the DLL, then after you call "addLegend", enter the following line of code:
c.getLegend().setMaxWidth(200)
(Enter the code anyway even if intellisense does not pop up the setMaxWidth. The intellisense may be caching the old version.)
Hope this can help.
Regards
Peter Kwan
|
|