How can I get the coordinates of a QPieSlice (center)?
Background: I want to add a "Callout" see here to my QChart which displays a QPieSeries. I have connected the hovered signal to a custom slot. In this slot, I have access to the QPieSlice. To display my "Callout" I need the x and y coordinates in my QChart coordinate frame. The anchor of the "Callout" should be the center of my currently hovered QPieSlice.
How can I get the coordinates of the QPieSlice center?
I tried something like:
double angle = pieSlice->startAngle()+pieSlice->angleSpan()/2;
double x = 1*cos(angle*deg2rad);
double y = 1*sin(angle*deg2rad);
callout->setAnchor(QPointF(x,y));