• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Modifying legend text with data source

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modifying legend text with data source

    Hello,

    Is it possible to modify the legend text in, say, a column chart widget, with data from a data source, like a sum of one of the axes? Or must the legend text be static?

    Thanks.
    Erin

  • #2
    Yes, it is under the "Legend" section.

    Screen Shot 2021-10-07 at 10.43.46 AM.png

    Comment


    • #3
      Isn't "2020 Sales" etc. static (constant, unchanging) text? I want a number from the data source to be part of it. Thanks.

      Comment


      • #4
        If your chart is a multi-series chart you can set the legend text based on an app variable;

        NAB Multi Series Legend Text.png

        Comment


        • #5
          All right, I see those in my chart. I've created two app variables and assigned them initial values:
          App variables.png
          Next I linked to my app variables:
          App variables link to.png
          The initial values aren't even showing in the legend:
          App Legend.png

          Comment


          • #6
            Once you get on the latest version if you're not already and it's still not showing your values please let us know because we can't replicate this on our end

            Thanks

            Comment


            • #7
              Found the problem. Was using the function SetValue() instead of SetAppVar(). Doh!

              Your info about the Multi Series properties was very much appreciated. I needed that piece of the puzzle. Thanks!

              Comment


              • #8
                Now wondering if it's possible to set the app variables on startup of the app?

                Comment


                • #9
                  You should be able to set app variables value via the startup application.

                  Comment


                  • #10
                    Yes, but I don't want to put constant values in the app variables. I'm currently setting them via a refresh button on a widget that calls an RPG program that sets the app variables. But I would like them to load on startup too.

                    Comment


                    • #11
                      So you’re setting the app variables via your startup program and they are not applying?

                      Comment


                      • #12
                        No, because I don't want static values; I want data from a data source. The RPG program sets the app variables (two sums from a file). But you can't run an RPG program from startup. So, this gives me questions:

                        Can a startup script be written that will get data from a data source or file? If so, how?
                        Or, can a startup script be written that will get data from a widget attached to a data source? If so, how? And, will the data already be loaded in the widget at the startup event? How do I find out what properties, methods, and functions are in a widget?
                        Or, can I trigger the refresh button which runs the RPG at startup?

                        Thanks.

                        Comment


                        • #13
                          You can run an RPG program from startup using "EXNABSTART" as your template;

                          NAB StartUp One.png

                          NAB StartUp Two.png

                          Comment


                          • #14
                            That's it! That was the answer. Thank you.

                            Comment

                            Working...
                            X