Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
Graph 面积图(海图)的数据标签位置问题_Graph_Highcharts_Area - Fatal编程技术网

Graph 面积图(海图)的数据标签位置问题

Graph 面积图(海图)的数据标签位置问题,graph,highcharts,area,Graph,Highcharts,Area,我创建了面积图JSFIDLE。单击上面的链接,找到我的代码供您参考 How to display the values like an uploaded image. 这可以通过使用以下方法来实现: chart: { type: 'area', inverted: false, events: { load: function() { let pointLabelPositions = [] let labelSeries = this.series

我创建了面积图JSFIDLE。单击上面的链接,找到我的代码供您参考

How to display the values like an uploaded image.

这可以通过使用以下方法来实现:

chart: {
  type: 'area',
  inverted: false,
  events: {
    load: function() {
      let pointLabelPositions = []
      let labelSeries = this.series[0]
      let otherSeries = this.series[1]
      for (var i = 0; i < labelSeries.data.length; i++) {
        pointLabelPositions.push({
          dataLabels: {
            y: (otherSeries.data[i].plotY - labelSeries.data[i].plotY) / 2
          }
        })
      }
      labelSeries.update({
        data: pointLabelPositions
      })
    }
  }
},
图表:{
类型:'区域',
倒:错,
活动:{
加载:函数(){
设pointLabelPositions=[]
设labelSeries=this.series[0]
让otherSeries=this.series[1]
对于(var i=0;i
$(函数(){
$(“#容器”)。高图({
图表:{
类型:'区域',
倒:错,
活动:{
加载:函数(){
设pointLabelPositions=[]
设labelSeries=this.series[0]
让otherSeries=this.series[1]
对于(var i=0;i


感谢您解决我的问题。有可能添加虚线而不是水平线图案吗?当然有可能,只需使用图案即可,下面是一个示例:。也就是说,我真的不明白为什么您使用的是
area
而不是
arearange
,它似乎更适合您正在做的事情。您的应用是正确的。但这应该是小虚线圈。如何在arearange中添加虚线