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

Message ListMessage List     Post MessagePost Message

  Custom symbol tool tip, 3 fields of data/values
Posted by Chuck on Mar-03-2022 23:32
Hi Peter,

Can you point me to a VB.NET code example of how I can get several fields of values in a tooltip for a custom symbol mouse-over?

I have the X and Y of the symbol, and would like to set the tooltip at the time the symbol is added to the chart.

Thank you for your help.
Chuck

  Re: Custom symbol tool tip, 3 fields of data/values
Posted by Peter Kwan on Mar-04-2022 23:03
Hi Chuck,

You can use Layer.addExtraFields to add extra fields to a data point. You can then use the fields in tooltips or the data labels.

The following is an example of using addExtraFields, and the field is used in the scatter labels.

https://www.advsofteng.com/doc/cdnet.htm#scatterlabels.htm

For your case, you can use the field(s) in the tooltip. I would suggest to use code like:

// Your original layer
Layer layer = c.addScatterLayer(dataX, dataY, ......);

layer.addExtraField(anArrayOfStrings_or_anArrayOfDouble)
layer.addExtraField(theSecondArrayIfAny)

Then in your tooltip, you use something like:

title='{field0} at ({x}, {y}) = {field1}'

The {field0} will be replaced with the content in the first extra field, and {field1} will come from the second extra field.

See:

https://www.advsofteng.com/doc/cdnet.htm#paramsub.htm
https://www.advsofteng.com/doc/cdnet.htm#Layer.addExtraField.htm
https://www.advsofteng.com/doc/cdnet.htm#Layer.addExtraField2.htm

Regards
Peter Kwan