<p>Has anyone looked at <a href="http://developer.yahoo.com/flash/" rel="nofollow noreferrer">Yahoo's ASTRA</a>? It's fairly nifty, but I had some issues creating a custom label for a pie chart. They have an example for a line chart, which overrides an axis's series's label renderer.  My solution was to override the <code>myPieChart.dataTipFunction</code>. For data that looks like:</p>
<pre><code>myPieChart.dataProvider =
  [ { category: &quot;Groceries&quot;, cost: 50 },
    { category: &quot;Transportation&quot;, cost: 175} ]
myPieChart.dataField = &quot;cost&quot;;
myPieChart.categoryField = &quot;category&quot;;
</code></pre>
<p>I wrote a function like this:</p>
<pre><code>import com.yahoo.astra.fl.charts.series.*
myPieChart.dataTipFunction = 
  function (obj:Object, index:int, series:ISeries):String {
    return obj.category + &quot;\n$&quot; + obj.cost;
  };
</code></pre>
<p>There's ceil(2.718281828459045) problems with this:</p>
<ol>
<li><p>I'm directly calling the category and cost properties of the data provider. The names are actually configurable when setting up the chart, I'd like to maintain that flexibility.</p>
</li>
<li><p>The default data tip would show the category, the cost (without a dollar sign), and the percentage it makes up in the pie chart. So here, I've lost the percentage. I just have no idea which property of what would hold that. It might be part of the series.</p>
</li>
<li><p>I probably only need to override the <code>dataItemRenderer</code> for the cost part of the series, but I don't know how to access it.  The documentation is a little ... lacking there.</p>
</li>
</ol>
<p>Normally I would just look at the default implementation of the <code>dataTipFunction</code> but it's all inside a compiled shm that's part of the components distributed from yahoo.</p>
<p>Can anyone help me complete this overridden function with percentage information and the flexibility mentioned in point 1?</p>

[{'answer_id': 35019, 'author': 'dlamblin', 'author_id': 459, 'author_profile': 'https://Stackoverflow.com/users/459', 'pm_score': 3, 'selected': True, 'text': '<p>Okay... so no-one\'s tried Astra, or people just avoid Flash questions.</p>\n\n<p>After a lot of guess work it turns out I needed to cast the series to a PieSeries and then work with those member functions, as the ISeries was useless on it\'s own.</p>\n\n<pre><code>myPieChart.dataTipFunction = \n  function (item:Object, index:int, series:ISeries):String {\n    var oPieSeries:PieSeries = series as PieSeries;\n    return oPieSeries.itemToCategory(item,index) + "\\n$" + \n           oPieSeries.itemToData(item) + "\\n" + \n           Number(oPieSeries.itemToPercentage(item)).toFixed(2) + "%";\n  };\n</code></pre>\n'}, {'answer_id': 68699, 'author': 'Josh Tynjala', 'author_id': 10768, 'author_profile': 'https://Stackoverflow.com/users/10768', 'pm_score': 0, 'selected': False, 'text': '<p>The Astra components are distributed with the complete source code. Flash CS3 components use compiled shims because otherwise you\'d need to manually add the raw source files to your classpath. As a bonus, they also improve compile times because they\'re already built for you. Look in the "Source" folder in the Astra zip file, and you\'ll find all the ActionScript classes for the Astra components.</p>\n'}]
['https://Stackoverflow.com/questions/33590', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/459/']