Values on top/inside bar charts

1
Are there any options or plotly options to display the values represented by the bars in a graph either on top of the bars or inside? 
asked
1 answers
0

If this is what you are looking for:

You can accomplish this by creating Text Labels in your JSON.  The JSON looks like this:

[ {
  "x": [ "giraffes", "orangutans", "monkeys" ],
  "y": [ 25.1, 12.2, 20.3 ],
  "type": "bar",
  "orientation": "v",
  "connectgaps": true,
  "hoveron": "points",
  "line": {
    "color": "blue",
    "shape": "linear"
  },
  "mode": "lines+markers",
  "fill": "none",
  "name": "Wild",
  "text":  ["25","12","20"],
  "textposition" : "auto",
  "hoverinfo": "none",
  "marker": {
    "color": "Blue"
  }
},
 
{
  "x": [ "giraffes", "orangutans", "monkeys" ],
  "y": [ 5.4, 2.3, 7.1 ],
  "type": "bar",
  "orientation": "v",
  "connectgaps": true,
  "hoveron": "points",
  "line": {
    "color": "blue",
    "shape": "linear"
  },
  "mode": "lines+markers",
  "fill": "none",
  "name": "Captive",
  "text":  ["5","2","7"],
  "textposition" : "auto",
  "hoverinfo": "none",
  "marker": {
    "color": "Blue"
  }
}
]

the values displayed in the bar are in the text element.

Hope that helps,

Mike

answered