highchart delete name in graphic

0

I need to remove the name of the series in the graph. I have tried a thousand ways and only managed to eliminate it from the legend. Any ideas? thanks

link

    
asked by Minniek 05.12.2017 в 17:56
source

1 answer

0

All HighCharts options are documented in great detail.


The labels of each series are:

plotOptions.series.label


Within the definition of the object:

Highcharts.chart('container', {
    plotOptions: {
        series: {
            label: {
                enabled: false
            }
        }
    }
});


  

* Do not confuse them with plotOptions.series.dataLabels ,   that those are the labels of each point.


Let's see it in your example:

Highcharts.chart('container', {
  chart: {
    type: 'line'
  },

  title: {
    text: 'EvsV'
  },

  yAxis: {
    title: '',
    plotLines: [{
      value: 100,
      width: 0.5,
      color: 'rgba(0,0,0,0.5)'
    }]
  },

  xAxis: {
    min: 0.5,
    categories: ['', 'Día 0', 'Día 1', 'Día 2', 'Día 3']
  },

  legend: {
    layout: 'vertical',
    align: 'right',
    verticalAlign: 'middle',
    itemMarginBottom: 15

  },

  tooltip: {
    shared: true,
    crosshairs: true,
    borderColor: Highcharts.getOptions().colors[2]
  },

  plotOptions: {
    series: {
      label: {
        enabled: false
      },
      dataLabels: {
        enabled: false
      }
    }
  },

  series: [{
    name: 'NH1',
    color: '#407ec9',
    data: [100, 100 + 12.1, 98, 77, 66],
  }, {
    name: 'NH2',
    color: '#5b6770',
    data: [100, (100 + 7.8), 73, 87, 56]
  }, {
    name: 'NH3',
    color: '#a4dbe6',
    data: [100, (100 + 6.7), 77, 89, 86]
  }, {
    name: 'NH4',
    color: '#b6b6b6',
    data: [100, (100 + 10.3), 98, 99, 86]
  }, {
    name: 'NH5',
    color: '#007482',
    data: [100, (100 + 7.5), 75, 95, 86]
  }, {
    name: 'NH6',
    color: '#3eb1c8',
    data: [100, (100 + 5.3), 88, 95, 86]
  }, {
    name: 'NH7',
    color: '#b9bcde',
    data: [100, (100 + 6.7), 77, 95, 86]
  }, {
    name: 'NH8',
    color: '#7d78c7',
    data: [100, (100 + 3), 99, 95, 86]
  }],

  credits: {
    enabled: false
  },

  exporting: {
    enabled: false
  }

});
#container {
  min-width: 310px;
  max-width: 800px;
  height: 400px;
  margin: 0 auto
}
<!-- Highcharts -->
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>


<!-- HTML -->
<div id="container"></div>
    
answered by 14.12.2017 в 03:38