05-09-2008, 02:53 PM
I'm working on a wrapper class that takes data and displays it in a Histogram. The problem I have is that when it draws the grid, the y axis does not start at zero (the lowest value to plot is 1, so it starts there). However, it does display the nodes below zero, even though they go outside the layout. Also, the labels for some of the points are not very clean (ie. 4.0000000001). See attached image of output graph.
This is a portion of my updateDisplayList function...
If I uncomment the line where I set the yScale min to 0, it causes the following error:
Which I guess is from trying to create an axis with out having it bound to any data.
Any ideas?
This is a portion of my updateDisplayList function...
Code:
if (axisLayoutChanged)
{
_vis.operators.remove(_axisLayout);
_axisLayout = new AxisLayout(
"data." + _xField,
"data." + _yField,
(getStyle("orientation") == HORIZONTAL),
(getStyle("orientation") == VERTICAL))
//_axisLayout.yScale.min = 0;
_vis.data.nodes.setProperties({
shape: (getStyle("orientation") == VERTICAL)?
Shapes.VERTICAL_BAR : Shapes.HORIZONTAL_BAR
});
_vis.operators.add(_axisLayout)
axisLayoutChanged = false;
};If I uncomment the line where I set the yScale min to 0, it causes the following error:
Quote:Error: Can't create scale with data to bind to.
at flare.vis.data::ScaleBinding/get scale()[C:\Projects\Play\flare\flare\src\flare\vis\data\ScaleBinding.as:204]
at flare.vis.data::ScaleBinding/set min()[C:\Projects\Play\flare\flare\src\flare\vis\data\ScaleBinding.as:95]
at components::Histogram/updateDisplayList()[C:\Projects\SOS\Histogram\src\components\Histogram.as:153]
at mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6214]
at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:657]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]
at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]
Which I guess is from trying to create an axis with out having it bound to any data.
Any ideas?