0

i have made some charts for spreader beams in Amcharts (Worpress) and want to change the toolstips,

  1. reverse the order of the 2 values.
  2. append "tonnes" and "metres" after the respective values.

I can swap the order they appear in the code to change the order they appear, but how to append in plain text after the digit values so it shows "8 tonnes: 2 metres"?

Code for these is below in the tooltipText:

 "series": [{
        "type": "LineSeries",
        "name": "30° Sling To Vertical Angle",
        "xAxis": "id-1",
        "yAxis": "id-2",
        "baseAxis": "id-1",
        "dataFields": {
            "valueY": "value1",
            "categoryX": "category"
        },
        "fillOpacity": 0.5,
        "strokeWidth": 2,
        "sequencedInterpolation": true,
        "sequencedInterpolationDelay": 100,
        "tooltipText": "{name}\n{categoryX}: {valueY}"
    }, {
        "type": "LineSeries",
        "name": "45° Sling To Vertical Angle",
        "xAxis": "id-1",
        "yAxis": "id-2",
        "dataFields": {
            "valueY": "value2",
            "categoryX": "category"
        },
        "simplifiedProcessing": true,
        "calculatePercent": true,
        "fillOpacity": 0.5,
        "strokeWidth": 2,
        "sequencedInterpolation": true,
        "sequencedInterpolationDelay": 100,
    "tooltipText": "{name}\n{categoryX}: {valueY}"

url is https://applifting.ga/modular-spreader-beams/sectionlift-6/

enter image description here

Thanks

  • Is it not gettng boring? [1](https://stackoverflow.com/questions/63413148/append-to-tooltips-in-amcharts) [2](https://stackoverflow.com/questions/63411718/amcharts-am4core-function-not-defined) [3](https://stackoverflow.com/questions/63409169/amcharts-chart-not-showing-up-in-wordpress) amCharts has nice documentations that answer all your questions so far. – JavaScript Aug 14 '20 at 12:57
  • Thanks mysterious user, you can stalk the next user now. – Paul Anthony McGowan Aug 14 '20 at 13:30

1 Answers1

0

Just swapped the order of the tool tip values and appended in plain text the denominator.