i have my own custom tool tip . for showing my tooltip i got the data from
onTooltipRender function of graph but when i have one data and i click on that marker default tooltip is showing .
onTooltipRender is not calling when i have one data .
When i click on that single marker i am getting this issue .Please check the attached screen shot and provide appropriate solution for this.
bellow is my code. i want to render onTooltipRender if i have only one
onTooltipRender: (TooltipArgs args) => tool(args),
tool(TooltipArgs args) {
if (personalMetricData.isNotEmpty) {
WidgetsBinding.instance?.addPostFrameCallback((_) {
setState(() {
showTooptip = true;
showlastTooptip = false;
dx = args.locationX;
dy = args.locationY;
selectIndex = args.pointIndex;
subtitle =
'${personalMetricData[selectIndex].percentage.toInt().toDouble().toStringAsFixed(1)}%';
boxColor = personalMetricData[selectIndex].percentage.isNegative
? AppColors.toolTipRed
: AppColors.parrotGreen;
headerValue =
'${personalMetricData[selectIndex].data.toDouble().toStringAsFixed(1)}';
suffixValue = widget.type;
// '${widget.type == 'topSpeed' ? 'km/h' : widget.type == 'totalDistance' ? 'km' : widget.type == 'possesion' ? '%' : 'min'}';
});
});
}
}