Closed aike1202 closed 3 weeks ago
or is there any other way to archive this
Hi @aike1202,
You can achieve your requirement by combining TooltipBehavior with exploding. By adding a builder to TooltipBehavior, you can obtain the pointIndex that corresponds to the hovered segment index. This pointIndex can then be used as the explodeIndex. We have provided a code snippet, sample, and user guide documentation for your reference. Please let us know if you have any additional requirements.
UG Link,
https://help.syncfusion.com/flutter/circular-charts/tooltip#tooltip-template
Code Snippet:
SfCircularChart(
tooltipBehavior: TooltipBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
color: Colors.transparent,
duration: 0,
builder: (data, point, series, pointIndex, seriesIndex) {
SchedulerBinding.instance.addPostFrameCallback((timeStamp) {
if (pointIndex != _pointIndex) {
setState(() {
_pointIndex = pointIndex;
});
}
});
return const SizedBox(
height: 0,
width: 0,
);
},
),
series: <CircularSeries>[
DoughnutSeries<ChartSampleData, String>(
explodeIndex: _pointIndex,
dataSource: [
ChartSampleData('Car', 70),
ChartSampleData('Motorcycle', 20),
ChartSampleData('Truck', 50),
ChartSampleData('Bike', 40),
ChartSampleData('Flight', 30),
],
xValueMapper: (ChartSampleData chartData, _) => chartData.details,
yValueMapper: (ChartSampleData chartData, _) => chartData.count,
cornerStyle: CornerStyle.bothCurve,
strokeColor: Colors.white,
explode: true,
)
],
);
Regards, Lokesh P.
thanks it works fine
Use case
now available gesture types are [ActivationMode.singleTap] [ActivationMode.doubleTap] [ActivationMode.longPress] [ActivationMode.none] ,it show tooltip on mouse hover onwindows , but not explodeing
Proposal