9 Replies Latest reply on Aug 8, 2008 9:40 AM by Newsgroup_User

    Creating Multiple Axis in Actionscript

    dustismo
      Does anyone have an example (or some pointers) as to how to create multiple axis using actionscript? following the example in the documentation and converting the mxml to actionscript does not work.

      Any help would be appreciated, thanks.
      Dustin
        • 1. Re: Creating Multiple Axis in Actionscript
          Level 7

          "dustismo" <webforumsuser@macromedia.com> wrote in message
          news:g7cpia$7ja$1@forums.macromedia.com...
          > Does anyone have an example (or some pointers) as to how to create
          > multiple
          > axis using actionscript? following the example in the documentation and
          > converting the mxml to actionscript does not work.
          >
          > Any help would be appreciated, thanks.
          > Dustin

          There's an example here:
          http://demo.quietlyscheming.com/ChartSampler/app.html
          (General Features>Secondary Axes)

          Right click to view source.


          • 2. Re: Creating Multiple Axis in Actionscript
            dustismo Level 1
            Thanks for the response. I have seen that example -- it creates the multiple axes in mxml. Like I said, there does not seem to be a way to do multiple axes in ActionScript (i.e. I need to create the axes at runtime).
            • 3. Re: Creating Multiple Axis in Actionscript
              Level 7
              Ping me off list at amy at magnoliamultimedia dot com, and I will try to
              make time to cobble you together a quick example between now and Monday. If
              that's not going to be fast enough, post back here and maybe someone else
              has the time.

              HTH;

              Amy

              "dustismo" <webforumsuser@macromedia.com> wrote in message
              news:g7csuq$b8b$1@forums.macromedia.com...
              > Thanks for the response. I have seen that example -- it creates the
              > multiple
              > axes in mxml. Like I said, there does not seem to be a way to do multiple
              > axes
              > in ActionScript (i.e. I need to create the axes at runtime).
              >


              • 4. Creating Multiple Axis in Actionscript
                I'm trying to do this as well. Can you help us on the forum so others can benefit?

                Thanks,
                Steve
                • 5. Re: Creating Multiple Axis in Actionscript
                  Level 7

                  "ssettl2" <webforumsuser@macromedia.com> wrote in message
                  news:g7f3e4$phq$1@forums.macromedia.com...
                  > I'm trying to do this as well. Why don't you help us on the forum so
                  > others can benefit?

                  I will probably post to my blog when it is done, I just need a reminder so I
                  don't forget.


                  • 6. Re: Creating Multiple Axis in Actionscript
                    Ok, can you post a link to your blog (or at least when it's ready?).
                    • 7. Re: Creating Multiple Axis in Actionscript
                      Level 7

                      "ssettl2" <webforumsuser@macromedia.com> wrote in message
                      news:g7f56k$rji$1@forums.macromedia.com...
                      > Ok, can you post a link to your blog (or at least when it's ready?).

                      http://flexdiary.blogspot.com/2008/08/charting-example.html

                      HTH;

                      Amy


                      • 8. Re: Creating Multiple Axis in Actionscript
                        dustismo Level 1
                        Yes!

                        I saw my problem immediately after looking at your code.
                        I was using setAxis("verticalAxis", axis) on the Series class instead of setVerticalAxis on the subclass.

                        It is a bit annoying that the compatible Series subclasses duplicate so many methods instead of having a shared base class or interface. Leads to me ugly code like this (maybe there is a better way, that I don't know about??):

                        if (this.series is LineSeries) {
                        (this.series as LineSeries).verticalAxis = vAxis;
                        } else if (this.series is ColumnSeries) {
                        (this.series as ColumnSeries).verticalAxis = vAxis;
                        } else if (this.series is AreaSeries) {
                        (this.series as AreaSeries).verticalAxis = vAxis;
                        }

                        But the important thing is that it works, so thank you very much

                        -Dustin

                        • 9. Re: Creating Multiple Axis in Actionscript
                          Level 7

                          "dustismo" <webforumsuser@macromedia.com> wrote in message
                          news:g7hr5m$sge$1@forums.macromedia.com...
                          > Yes!
                          >
                          > I saw my problem immediately after looking at your code.
                          > I was using setAxis("verticalAxis", axis) on the Series class instead of
                          > setVerticalAxis on the subclass.
                          >
                          > It is a bit annoying that the compatible Series subclasses duplicate so
                          > many
                          > methods instead of having a shared base class or interface. Leads to me
                          > ugly
                          > code like this (maybe there is a better way, that I don't know about??):
                          >
                          > if (this.series is LineSeries) {
                          > (this.series as LineSeries).verticalAxis = vAxis;
                          > } else if (this.series is ColumnSeries) {
                          > (this.series as ColumnSeries).verticalAxis = vAxis;
                          > } else if (this.series is AreaSeries) {
                          > (this.series as AreaSeries).verticalAxis = vAxis;
                          > }

                          I'm not seeing anything that would work. But I really haven't worked with
                          charts that much.

                          > But the important thing is that it works, so thank you very much

                          You're welcome :-)