简体   繁体   English

Highcharts -> 如何在栏上添加垂直标题? 如何使图例中的符号成为矩形?

[英]Highcharts -> how to add vertical title to bar? how to make the symbol in the legend a rectangle?

`https://codepen.io/martynakil/pen/BawpPJv`

how to add vertical title to bar?如何在栏上添加垂直标题? how to make the symbol in the legend a rectangle?如何使图例中的符号成为矩形?

I need:我需要:

  1. title vertical标题垂直
  2. symbol a reactangle符号反应角
  3. a vertical line that separates the negative value from the positive value将负值与正值分开的垂直线

THANK YOU!谢谢你!

here screenshot [screenshot] enter image description here here screenshot [screenshot]在此处输入图像描述

  1. Use data labels:使用数据标签:

  series: [{
      dataLabels: {
        enabled: true,
        verticalAlign: 'bottom',
        align: 'left',
        inside: true,
        rotation: -90,
        x: -20,
        y: -10
      },
      name: "John",
      data: [{
        dataLabels: {
          format: 'Apples'
        },
        y: 5
      }, ...]
    },
    ...
  ]
  1. Highcharts: Make the legend symbol a square or rectangle Highcharts:使图例符号为正方形或矩形

  2. Use plotlines:使用情节线:


  yAxis: {
    ...,
    plotLines: [{
      value: 0,
      zIndex: 4
    }]
  }

Live demo: http://jsfiddle.net/BlackLabel/hfamwetg/现场演示: http://jsfiddle.net/BlackLabel/hfamwetg/

API Reference: https://api.highcharts.com/highcharts/series.column.dataLabels API 参考: https://api.highcharts.com/highcharts/series.column.dataLabels

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM