Hi,

I got Ely Greenfield's DataDrawingCanvas component and it works great
but I have one problem which I cannot solve:

In a plot chart, I create labels next to plot points that are
draggable through custom itemrenderer. Since the linear axis does not
clear the labels in min/max by default, I create a "shadow"
DataDrawingCanvas to mirror the positions of labels to force the axes
to recalculate. Once a user drags a label, I update the
DataDrawingCanvas but the axes do not recalculate even though the
DataDrawingCanvas objects are updated. The axes only recalculate if
the data behind the chart gets changed and the chart has to redraw.

I think it has something to do with a LinearAxis bug that does not
relcalculate min/max properly. Can I force the axis to recalculate? I
already tried to set the min/max to 1 and then to undefined and that
did not work either.

Please help! I have been tried to solve this for days...

Here is the function that I use to recreate the "shadow"
DataDrawingCanvas (id="optionLabels").

public function renderOptionLabels():void
{
        frontierXAxis.maximum = 1;
        frontierXAxis.maximum = undefined;
        frontierYAxis.maximum = 1;
        frontierYAxis.maximum = undefined;
        
        var visible:Boolean = globalData.allocationsVisible;
        
        while(optionLabels.numChildren > 0)
                optionLabels.removeChildAt(0);
        if (visible) {
                var
mix:Array=globalData.scenarioData[globalData.selScenarioPos].M.source
as Array;
                for(var i:int = 0;i<mix.length;i++)
                {
                        var l:Label = new Label();
                        l.setStyle("color",0x0B333C);
                        l.setStyle("fontSize", 11);
                        l.setStyle("fontFamily", "Verdana, Arial, Helvetica");
                        l.text = mix[i].label;
                        optionLabels.addChild(l);
                        optionLabels.updateDataChild(l,{left:
[Number(mix[i].x),mix[i].labelXOff], top:
[Number(mix[i].y),mix[i].labelYOff]});
                }
        }
}

Reply via email to