Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yep, it's a bug in AreaSeries. Due to the stupid way that flex charts are designed, the only real way to fix it is to set a custom <code>dataTipFunction</code> on the AreaChart.</p> <p>Here's a copy of the relevant code with the bug fixed:</p> <pre><code>/** * Create a data tip function for the given AreaSeries. Uses a copy of * the formatDataTip code from AreaSeries with the minValue bug fixed. * * @param series * @return a data tip function * */ private function createAreaSeriesTipFunc(series:AreaSeries):Function { var displayName:String = series.displayName; var dataTransform:DataTransform = series.dataTransform; var xField:String = series.xField; var minField:String = series.minField; // formatDataTip relies on AreaSeries member data so simulate that // with a closure to minimize code modifications return function(hd:HitData):String { var dt:String = ""; var n:String = displayName; if (n &amp;&amp; n != "") dt += "&lt;b&gt;"+ n + "&lt;/b&gt;&lt;BR/&gt;"; var xName:String = dataTransform.getAxis(CartesianTransform.HORIZONTAL_AXIS).displayName; if (xName == "") xName = xField; if (xName != "") dt += "&lt;i&gt;" + xName + ": &lt;/i&gt;"; var item:AreaSeriesItem = AreaSeriesItem(hd.chartItem); var lowItem:AreaSeriesItem = (minField != "") ? item : null; dt += dataTransform.getAxis(CartesianTransform.HORIZONTAL_AXIS).formatForScreen(item.xValue) + "\n"; var yName:String = dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS).displayName; if (!lowItem) { if (yName != "") dt += "&lt;i&gt;" + yName + ":&lt;/i&gt; "; dt += dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS).formatForScreen(item.yValue) + "\n"; } else { if (yName != "") dt += "&lt;i&gt;" + yName + " (high):&lt;/i&gt; "; else dt += "&lt;i&gt;high: &lt;/i&gt;"; dt += dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS).formatForScreen(item.yValue) + "\n"; if (yName != "") dt += "&lt;i&gt;" + yName + " (low):&lt;/i&gt; "; else dt += "&lt;i&gt;low:&lt;/i&gt; "; dt += dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS).formatForScreen(lowItem.minValue) + "\n"; } return dt; }; } </code></pre> <p>I just changed <code>formatForScreen(lowItem.yValue)</code> to <code>formatForScreen(lowItem.minValue)</code> in one place. You can use it like this:</p> <pre><code>&lt;mx:AreaChart dataProvider="{chartData}" showDataTips="true" dataTipFunction="{createAreaSeriesTipFunc(areaSeries)}"&gt; &lt;mx:series&gt; &lt;mx:AreaSeries id="areaSeries" yField="TotalVariableCost" minField="TotalFixedCost" displayName="Total Cost" /&gt; &lt;/mx:series&gt; &lt;/mx:AreaChart&gt; </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. VO
      singulars
      1. This table or related slice is empty.
    2. 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