Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is possible to exclude some series from the chart legend.</p> <p>Every chart class (extending ChartBase) has a legendData Array property. This legendData has a list of LegendItem's. If you create a newArray based on the legendData, but with only the LegendItem's that you want; then you can set that array as the dataProvider for your legend.</p> <p>Also, you can create your own array of LegendItem's based on LegendItems that you create from scratch. And use that array as the dataProvider for the Legend. </p> <p>For example, here I only display the first and third series in my legend:</p> <pre><code>&lt;mx:Script&gt; &lt;![CDATA[ private function cc(event:Event):void { var newArray:Array = new Array(); newArray.push(myChart.legendData[0]); newArray.push(myChart.legendData[2]); myActionScriptLegend.dataProvider = newArray; } ]]&gt; &lt;/mx:Script&gt; &lt;mx:ColumnChart id="myChart"&gt; &lt;mx:series&gt; &lt;mx:ColumnSeries id="series0"/&gt; &lt;mx:ColumnSeries id="series1"/&gt; &lt;mx:ColumnSeries id="series2"/&gt; &lt;/mx:series&gt; &lt;/mx:ColumnChart&gt; &lt;mx:Legend dataProvider="{[myChart.legendData[0],myChart.legendData[2]]}" /&gt; &lt;mx:Legend id="myActionScriptLegend" creationComplete="cc(event)" /&gt; </code></pre> <p><a href="http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/ChartBase.html#legendData" rel="noreferrer">http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/ChartBase.html#legendData</a><br> <a href="http://livedocs.adobe.com/flex/3/langref/mx/charts/LegendItem.html" rel="noreferrer">http://livedocs.adobe.com/flex/3/langref/mx/charts/LegendItem.html</a><br> <a href="http://livedocs.adobe.com/flex/3/html/charts_displayingdata_12.html#330954" rel="noreferrer">http://livedocs.adobe.com/flex/3/html/charts_displayingdata_12.html#330954</a> </p>
    singulars
    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.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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