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

Message ListMessage List     Post MessagePost Message

  How to make bold a value inserted in the chart legend ?
Posted by Daniel on Nov-28-2014 21:08
Attachments:
Hello Peter,

I know that my issue should be easy to you and for this reason I request your support  to
customize a XY Chart legend. On short, I have to include in the legend the latest value of
my data but I would like to bold that number. The issue is that parameter (called "name",
which is the third parameter of the addDataSet method) does't have any properties related
to fonts. To be more clear, below are the vb code lines involved in my chart :

Dim layer As LineLayer
Set layer = c.addLineLayer2()
Call layer.setLineWidth(3)  'Set the lines width to 2 pixels
Call layer.addDataSet(data0, &H66CC, "UMTS All Layers (" & data0(100) & ")")   'blue
Call layer.addDataSet(data1, &HCC0000, "UMTS Layer 1 (" & data1(100) & ")")   'red

As you can see in the image attached, I have highlighted in yellow the values which I
would like to appear as bold text. Thank you for any suggestion.

Regards,
Daniel
xyChart.PNG

  Re: How to make bold a value inserted in the chart legend ?
Posted by Peter Kwan on Nov-28-2014 22:39
Hi Daniel,

You can use CDML to format the text. The sample code "Simple Realtime Chart" is an
example that shows how the numbers can use a different text style. In this example, CDML
is used to set a different background color for the numbers. For your case, you can use
CDML to set a different font for the numbers. For example:

Call layer.addDataSet(data0, &H66CC, "UMTS All Layers (<*font=arialbd.ttf*>" &
data0(100) & "<*/font*>)")

Hope this can help.

Regards
Peter Kwan

  Re: How to make bold a value inserted in the chart legend ?
Posted by Daniel on Nov-28-2014 23:52
Hi Peter,

Thank you for this quick reply. It worked perfectly. I didn't know that mark-up language
can be used inside CD such an easy way. Thank you very much.

Have a good day !

Daniel