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

Message ListMessage List     Post MessagePost Message

  Problem with adding an image after a cdml block of truncated text
Posted by Eva on Apr-15-2016 21:47
Attachments:
Hi Peter,

I need help with the CDML format.  I'm trying to add an image after a text formatted in <*block*> with the truncate attribute of 1.
My problem is that the image is not displayed most of the times when the text is truncated. If the text is not truncated, it works as desired.

The labels are added to each cell of the axis table created with
c.xAxis().makeLabelTable().
I attached a screenshot of my result chart with two labels: the top one is short and it includes the icon. The second has a truncated text and the icon is not included (and it should).

The labels are added into an axis table with the following code:

xAxisTable.setCell(, , , , label_i);
where labels are defined as:

label_1 = "<*font=Arial, color=111111*><*block, valign=middle, maxwidth=232,
truncate=1*>   Start<*/*><*/font*><*block width=12*><*img=images/Exclamation.png*><*/*>";

label_2 = "<*font=Arial, color=111111*><*block, valign=middle, maxwidth=232,
truncate=1*>   Test task with looooong name, icon and
direction<*/*><*/font*><*block
width=12*><*img=images/Exclamation.png*><*/*>";

The width of a table cell is 250px. I made the maxwidth smaller to fit the width of the icon, which is really 10 px.

With some examples I tested, VERY sporadically the icon does appear with the truncated text, but not for all labels that require it. In these rare situations it also depends on the maxwidth I set.
I hope you know the trick.

Thank you,
Eva
Truncate label and icon.png

  Re: Problem with adding an image after a cdml block of truncated text
Posted by Peter Kwan on Apr-16-2016 04:45
Hi Eva,

I have tried myself and can reproduce the issue. It looks like a bug in ChartDirector. I will investigate it further.

As a work around, would you consider to put the icon on the left side instead?

Regards
Peter Kwan

  Re: Problem with adding an image after a cdml block of truncated text
Posted by Eva on May-19-2016 04:37
Hi Peter,

No, I need to put the images after the text. I calculated the ellipsis myself. It's not as precise as done by the ChartDirector, but I can live with it for now..

Thank you,
Eva