Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Interactive Chart Tool: add data labels to bar chart?

kelly_gilbert
13 - Pulsar

Is it possible to add data labels to a bar chart in the Interactive Chart Tool? This was possible in the deprecated Charting Tool, but I can't figure out how to add labels in the new Interactive Chart Tool.

 

I see that there is an option to add labels for a pie chart, but can't find that option for a bar chart.

 

The chart I'd like to replicate is something like this:

Bar chart with labels.png

Thanks!

 

18 REPLIES 18
mbarone
16 - Nebula
16 - Nebula

Hi Kelly,

No, this is not currently possible.  I could've sworn I posted this issue as an idea a few months ago, but I can't for the life of me find it.  Ever post an idea?  Create one, and then people can "star" it, which will get it more visibility.

 

But first let's check with Alex (@apolly) to see if they already have it on their plan.  Alex - I thought I reported this a few months ago, but I cannot remember.  Is this on the plan to modify?  Especially important when rendering to PDF, where you can't hover.  Thanks!

kelly_gilbert
13 - Pulsar

Thanks, @mbarone - I'll definitely add it as a new idea, if I can't locate yours. I wanted to make sure I wasn't missing something obvious!

BDavisAlight
5 - Atom

I had the same question and got some help by editing the xml. 

There is not out-of-the-box configuration that you missed.  That feature is just not exposed via the Interactive Chart Tool.  A little XML editing within the designer you can turn this capability.

 

Step 1) Turn on Display XML Properties Window - https://help.alteryx.com/current/Getting_Started/GlobalSettings.htm?Highlight=XML

Step 2) Highlight the Interactive Chart tool on the canvas and go to its XML properties within the configuration window

Step 3) Modify the <mode> tag from <mode>lines</mode> to <mode>line+text</mode>

Step 4) Next add the following between the <TRACES> </TRACES> xml tag. 

<textsrc>Avg_Discount</textsrc>

<textposition>auto</textposition>

 

Where “Avg_Discount” is the column name from the canvas input stream that will act as a list for the chart labels.  What happens now, is that the next time you run it will automatically add (or update) the values to the bar graph by adding a series of <TEXT>value</TEXT> statements under the <TRACES> XML tag and will display on your bar chart.    Check out below.

 

chart.jpg

ianrchristensen
5 - Atom

Can you share your full XML code from <Traces> to </Traces> for this chart?

apolly
Alteryx Alumni (Retired)

Hi, sorry for delayed response. Thank you all for your thoughts on this matter. We understand how important this is to charting and how it is necessary when outputting to static format with no hover information. We have this on our roadmap, but are not currently working it and I am unable to comfortably provide a timeline for when this will be available in the configuration menu. It is a high priority for us and we hope to get your this capability soon. Please reach back out with questions/recommendations and I will share as much as I can with you.

BDavisAlight
5 - Atom

This is a different chart but still applies. 

 

This is the XML Prior to updates:

    <Traces json:Array="true" xmlns:json="http://james.newtonking.com/projects/json">
      <type>bar</type>
      <mode>markers</mode>
      <orientation>v</orientation>
      <xsrc>Today</xsrc>
      <ysrc>Sum_Count</ysrc>
    </Traces>

Added "+text" to <mode>markers+text</mode> (this could be line and you would add "+text" to be line+text)

added <textsrc>Sum_Count</textsrc> (data value you want to display)

added <text position>auto</textposition>

    <Traces json:Array="true" xmlns:json="http://james.newtonking.com/projects/json">
      <type>bar</type>
      <mode>markers+text</mode>
      <orientation>v</orientation>
      <xsrc>Today</xsrc>
      <ysrc>Sum_Count</ysrc>
      <textsrc>Sum_Count</textsrc>
      <textposition>auto</textposition>
    </Traces>

result:

chart.png

TheAmazingDP
5 - Atom

Thoughts on how you would add a thousands separator to format the text shown?

mlehar
5 - Atom

Thanks for this work around, it works great!

 

I am having one problem with it though, it seems like the chart label values only update when I open the "configure chart" window. I'm using the interactive chart tool in a macro, so the values aren't updating correctly. Any ideas?

TheAmazingDP
5 - Atom

I ran into this as well, and others with the charting tool...

The work around I did for this was just create a Title with an additional line for the data value field, then combine the report text and the chart using a layout tool.
2019-04-10_14-25-35.jpg

 

Lots of opportunity for improvement on this tool, slightly disappointed that some of the more basic charting functionality was left out (like charting values aside from floats and ints....like percentages/money)

Labels