Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在c3.js onclick事件中获取自定义标签_Javascript_Angular_Charts_Bar Chart_C3.js - Fatal编程技术网

Javascript 如何在c3.js onclick事件中获取自定义标签

Javascript 如何在c3.js onclick事件中获取自定义标签,javascript,angular,charts,bar-chart,c3.js,Javascript,Angular,Charts,Bar Chart,C3.js,添加图像以便更好地理解 在c3.js条形图中的函数内部数据下面使用 onclick: function(d,i){ console.log("onclick",d,i); }, 电流输出: x: 1, value: 200, id: "August", index: 1, name: "August" } 预期产出 { x: 1, value: 200, id: "August"

添加图像以便更好地理解

在c3.js条形图中的函数内部数据下面使用

onclick: function(d,i){
  console.log("onclick",d,i);
},
电流输出:

  x: 1,
  value: 200,
  id: "August",
  index: 1,
  name: "August"
}
预期产出

{
  x: 1,
  value: 200,
  id: "August",
  index: 1,
  name: "August", 
  label: cable // or E-commerce // or G2C // or IT etc.
}
我也经历过,但在这个例子中,只有索引号得到。我需要提取图像中显示的标签s