Concatonating for Legends

DataGraph Forums General Getting Started Concatonating for Legends

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by dgteam.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12420
    elaine baker
    Participant

      I was wondering if there is an easy way to concatenate  a column or labels with a column of figures? (other than using excel and creating a new column in DataGraph)

      I was hoping I could do this in the expression column, but I don’t think it works with text – I’d like to be able to take the text from one column and join it with the figure for use in the legend, eg:

      Blue cars, 25%
      Red cars, 40%
      Purple bikes, 12%

      I’m hoping not to have to resort to the manual legend, as there are a lot of charts and they change monthly.

      Thank you

      #12421
      dgteam
      Moderator

        It sounds like you could use the Text expression column. Here is an example with a Pie chart.

        The data has one text column and one number column. The column ‘Percentages’ is a Number from command column that uses a Pie command to calculate the percentages.  The column ‘Legend’ is the Text Expression column.  This is added using the Other drop-down menu above the column list. Here, you can combine text and column entries. The blue entries in the text expression are tokens. Add the tokens using the + symbol on the right side of the text box.

        Legend1

        Here is the list of corresponding commands and the final graph. Note the first Pie command is used to output the percentages and is not drawn. A second Pie command has Values = ‘data’ and Names =  ‘Legend’.

        Legend2

        Note that we could have calculated the percentages in the data table, but it is convenient to use the pie command itself because there are rules for rounding already built into the pie command. Also, we cannot do this in just one pie command because it will end up with a circular reference.

        This example is a bit specific to the pie command, but hopefully this gives you some ideas. If you’re still stuck, let us know.

         

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      DataGraph Forums General Getting Started Concatonating for Legends