3 Replies Latest reply on Sep 24, 2010 12:19 PM by georgewr3

    chart alignment question

    georgewr3

      I'm new to flex and I'm trying to stack several line charts on top of each other and with the

      defaults, they line up easily. However if I disable the horizontal axis with hAxisRenderer.setStyle("showLabels", false) for all the but top and bottom charts, they no longer line up. (I don't want the same set of labels for every chart in the stack since they are the same) It appears that the horzontal size of the chart will include the axis if it's visible so the widths will be off.

       

      I tried to not use the showLabels call and set the alpha to zero and that does get rid of the axis visually and keeps the charts aligned but then the space where the axis would normally be visible is always there and the only way I've found to reclaim that space is a hack like negative top padding but that presents other alignment problems. I also tried the .includeInLayout call but it didn't work either

       

      So how can I get rid of the horizontal axis and reclaim that space on some of the charts in a stack but keep them aligned horizontally?

        • 1. Re: chart alignment question
          Devtron Level 3

          do you have a screenshot of the problem?

           

          what type of layout container do the charts reside in?

          • 2. Re: chart alignment question
            georgewr3 Level 1

            There are 2 VBoxs stacked vertically. I added the red borders just to visualize the problem. The upper VBox contains a bar chart. The first circled area shows the place where the upper VBox meets the lower. The lower VBox contains 2 (empty) line charts with red borders around each linechart. You can see in the lower circled area there is a larger space. I believe that is the area that would be occupied by the horizontal axis. It's actually there but with an alpha of zero. Notice also that the unit lines line up between all the charts which is what I want. However if I try to remove the horizontal axis with .visible and showLabels, it causes misalignment of the charts as in screenshot 2. I believe that is because the overall horizontal width will include the horizontal axis even if it's invisible due to the alpha but it will not include it if .visible and/or showLabels is false and the last axis data value sticks out beyond the gray area. The red borders did nothing to complicate the problem.

             

            I cannot think of a solution that would keep the charts lined up but have some with horizontal axis and some without and reclaiming that axis space.

             

            Thanks.

             

             

            Screenshot 1

            1.PNG

             

            Screenshot 2

            2.PNG

            • 3. Re: chart alignment question
              georgewr3 Level 1

              Anyone from Adobe care to comment?