I am new to fusionchart and am trying to add more data to a specific datapoint in the tooltip.
As seen below i tried adding a var to the data array and reference it in the tooltiptext like label and value are referenced.
dataSource: {
"chart": {
"theme": "fusion",
"caption": "lorem ipsum",
"subCaption": "lorum ipsum",
"xAxisName": "Date",
"yAxisName": "time",
"labelDisplay": "Rotate",
"reversalPercentage": "0",
"axisLineAlpha": "40",
"rallythickness": "3",
"declinethickness": "3",
"showToolTip": "1",
"plottooltext": "$label <hr> lorum ipsum <b>$value</b> $example",
},
"data": [{
"label": "date",
"value": "time",
"example": "more info"
},
etc
]
I expected this to add more info to a specific datapoint but the tooltip just says $example.
You can use tooltip macros to customize chart labels, data values, display values, etc. as variables, and plain text, to form a completely customized tooltip text. Each chart contains labels, raw values, formatted values, display values, etc., as variables that you use in conjunction with your custom text to form the complete tooltext.
Tooltips can be configured to include supplementary information about the data plotted on a chart. Macros allow you to automate the inclusion of this information, saving the effort of manual customization.
Keep the following pointers in mind when using macros:
Macros are case-insensitive.
A macro which is not applicable will be treated as string.
To use a macro name as text in tooltip use "" before the "$" sign. Example: to show "$value" in tooltip use "$value" in tooltext attribute.
Tooltext can also be configured from corresponding parent nodes (that is, chart, dataset, etc.).
Refer the code below:
To know more about this feature please refer the docs - https://www.fusioncharts.com/dev/chart-guide/chart-configurations/tool-tips#introduction-to-macros
Here is the demo fiddle - https://jsfiddle.net/L935gqf7/
Hope it would be help you out.