JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: false,
axisY:{
reversed: true,
},
toolTip: {
shared: true
},
legend:{
cursor: "pointer",
},
data: [
{
type: "bar",
showInLegend: false,
name: "Gold",
color: "gold",
indexLabel: " ",
axisXType: "secondary",
dataPoints: [
{ y: 100, label: "USA", name: "Gold" },
{ y: 269, label: "EU", name: "Gold" },
]
},
{
type: "error",
name: "Gold",
lineColor:"yellow",
whiskerColor: "gray",
axisXType: "secondary",
indexLabelTextAlign: "left",
dataPoints: [
{ y: [0, 30], label: "USA", color: "red", indexLabel: "{label} - {y[1]}" },
{ y: [0, 6], label: "EU", color: "red", indexLabel: "{label} - {y[1]}"},
{ y: [0, 0], label: " ", color: "white" },
{ y: [0, 0], label: " ", color: "white" },
]
},
{
type: "bar",
showInLegend: false,
name: "Silver",
color: "silver",
indexLabel: " ",
axisXType: "secondary",
dataPoints: [
{ y: 90, label: " ", name: "Silver" },
{ y: 150, label: " ", name: "Silver" },
]
},
{
type: "error",
name: "Silver",
lineColor:"yellow",
whiskerColor: "gray",
axisXType: "secondary",
indexLabel: "{name} - {y[1]}",
dataPoints: [
{ y: [0, 100], label: "USA",...