You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Gareth Daniel Smith (JIRA)" <ji...@apache.org> on 2012/07/20 12:50:33 UTC

[jira] [Commented] (FLEX-33141) CartesianChart renders an extra axis when a chart is created with no axis and then some axis are added later

    [ https://issues.apache.org/jira/browse/FLEX-33141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419052#comment-13419052 ] 

Gareth Daniel Smith commented on FLEX-33141:
--------------------------------------------

I have created this class as a work-around for the issue:

import mx.charts.LineChart;
import mx.core.mx_internal;

use namespace mx_internal;

public class PatchedLineChart extends LineChart {

    public function PatchedLineChart() {
    }

    override public function set verticalAxisRenderers(value:Array):void {
        super.verticalAxisRenderers = value;
        if (value.length > 0) {
            super.verticalAxisRenderer = null;
        }
    }

    override public function set horizontalAxisRenderers(value:Array):void {
        super.horizontalAxisRenderers = value;
        if (value.length > 0) {
            super.horizontalAxisRenderer = null;
        }
    }
}
                
> CartesianChart renders an extra axis when a chart is created with no axis and then some axis are added later
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33141
>                 URL: https://issues.apache.org/jira/browse/FLEX-33141
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Charts:Multiple Axes
>    Affects Versions: Adobe Flex SDK 4.5 (Release)
>         Environment: Mac OS X
>            Reporter: Gareth Daniel Smith
>            Priority: Minor
>
> I have a use-case where a LineChart is created with series=[] and then later on, after the chart has been displayed to the user, the series changed to be non-empty. Essentially I have a GUI that shows a user an empty chart and then allows the user to add series to it.
> When the chart is created without any series then a default axis is shown. This is OK. The issue is that this default axis does not go away when some real series (with their associated axis) are added to the chart.
> I think this happens because of the first few lines in CartesianChart.commitProperties which create default horizontal/vertical axisRenderers if there are none in the user-supplied horizontal/vertical axisRenderers array. I think the problem is that horizontalAxisRenderer/verticalAxisRenderer never get set back to null when the user-supplied axis renderers arrays are changed to be none-empty.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira