Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Timofei Davydik gave a very good answer, and it helped my work with datatips also</p> <p>However I see in the comments that there was some confusion about how exactly to work with overriding the two massive functions, <code>ChartBase.positionDataTips</code> and <code>ChartBase.positionAllDataTips</code>.</p> <p>A way to do this would be to do the following:</p> <ol> <li>Create a new chart class that extends ChartBase or a child of that.</li> <li>Set the ChartBase style, <code>showDataTipTargets</code>, to false.</li> <li>Create a new Style, <code>showCustomDataTipTargets</code>, on your custom chart class.</li> <li>Override <code>positionDataTips</code> and <code>positionAllDatatips</code></li> </ol> <p>The new overridden functions should look something like this:</p> <pre><code>override protected function positionDataTips():void { this.setStyle("showDataTipTargets", false); // this will do all the normal rendering of the datatips and callout // but it will not draw the dataTipTarget because that is dependent upon // the style, showDataTipTargets super.positionDataTips(); // now here you draw your custom datatip target. // Use the following code as a guide, it is // copied from the ChartBase.positionDataTips /* if (len &gt; 1) { if (calloutStroke) { calloutStroke.apply(g,null,null); if (tipData.isRight) { g.moveTo(chartLocalPts.x, chartLocalPts.y + tipData.height / 2); g.lineTo(tipData.x, chartLocalPts.y + tipData.height / 2); g.lineTo(tipData.x, tipData.y); } else { if(layoutDirection == LayoutDirection.RTL) { g.moveTo(chartLocalPts.x - tipData.width, chartLocalPts.y + tipData.height / 2); } else { g.moveTo(chartLocalPts.x + tipData.width, chartLocalPts.y + tipData.height / 2); } g.lineTo(tipData.x, chartLocalPts.y + tipData.height / 2); g.lineTo(tipData.x, tipData.y); } } } var tipColor:uint = tipData.hd.contextColor; g.lineStyle(1, tipColor, 100); g.moveTo(tipData.x, tipData.y); g.beginFill(0xFFFFFF, 1); g.drawCircle(tipData.x, tipData.y, TOOLTIP_TARGET_RADIUS); g.endFill(); g.beginFill(tipColor, 1); g.drawCircle(tipData.x, tipData.y, TOOLTIP_TARGET_INNER_RADIUS); g.endFill(); */ } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload