Display a date into a tooltip

#1

I have a tooltip that show up after the mouse pass on a line result of a metric contained into a sparkline.
together with the value shown in the tooltip the represents energy consumption I want to show also the date of the data point.
I saw a property tooltipFormatter that should allow to do this - is something that we support? any insight on how to fit this requirement?

or other option can I use

“tooltip”: {
pointFormat: ‘{point.x} date, {point.y} Kg’
}

directly into the below code? and how can i set the point.y to be the value of the metric?

        {
            "id": "metrics",
            "width": 100,
            "label": "{~RevenueProtection.ListComponent.columns.sparkLine.label~}",
            "colType": "sparkline",
            "sparkline": [
                {
                    "field": "ElectricityConsumptionLegacy",
                    "type": "line",
                    "name": "En.Att+ Mens.",
                    "color": "green"

                },
                {
                    "field": "YearMonth",
                    "type": "line",
                    "name": "AnnoMese",
                    "color": "orange"

                }
            ]
        }
0 Likes