Charts

Certified Senior Developer

Hello ,

Is there an option to add Text on the data label in bar charts..i have an requirement to display stacked charts and then need to add the text entries for each item. Also looking to display some percentages there,,please let me know if anyone have idea regarding this.Thanks

  Discussion posts and replies are publicly visible

Parents
  • Bar charts have a property for displaying the data labels "showDataLabels". Just set that to true.
    I do not think its possible to change what the label is since its just the data point that was passed in. One idea I can think of to accomplish what you want is to first convert the values into a percentage of the whole. Then when you pass them into the chart they will already be a percent so when you show the labels they will be correct.
    Here is an example of a stacked bar chart with data labels.

    a!barChartField(
    categories: {"Americas", "EMEA", "APAC"},
    series: {
    a!chartSeries(label: "Referrals", data: {19, 8, null}),
    a!chartSeries(label: "Existing Clients", data: {11, 16, 10}),
    a!chartSeries(label: "Tradeshow Attendees", data: {14, 12, 7})
    },
    yAxisTitle: "Active Opportunities",
    stacking: "NORMAL",
    showLegend: true,
    showDataLabels:true
    )
Reply
  • Bar charts have a property for displaying the data labels "showDataLabels". Just set that to true.
    I do not think its possible to change what the label is since its just the data point that was passed in. One idea I can think of to accomplish what you want is to first convert the values into a percentage of the whole. Then when you pass them into the chart they will already be a percent so when you show the labels they will be correct.
    Here is an example of a stacked bar chart with data labels.

    a!barChartField(
    categories: {"Americas", "EMEA", "APAC"},
    series: {
    a!chartSeries(label: "Referrals", data: {19, 8, null}),
    a!chartSeries(label: "Existing Clients", data: {11, 16, 10}),
    a!chartSeries(label: "Tradeshow Attendees", data: {14, 12, 7})
    },
    yAxisTitle: "Active Opportunities",
    stacking: "NORMAL",
    showLegend: true,
    showDataLabels:true
    )
Children