简体   繁体   English

HighCharts 组织图字号

[英]HighCharts organization diagram font size

I can't set the font size on organization diagram, I want to be in 'em' unit because isn't looking good on mobile device.我无法在组织结构图中设置字体大小,我想在“em”单元中,因为在移动设备上看起来不太好。

I already tried:我已经尝试过:

Highcharts.chart('container', {
  chart: {
    height: 600,
    inverted: true
  },

  title: {
    text: 'Highcharts Org Chart'
  },

  dataLabels: {
    style: {
        fontSize: '30px'
    }
  },
  series: [{
    type: 'organization',
    name: '',
    keys: ['from', 'to'],
    data: [
        ['Shareholders', 'Board'],
        ['Board', 'CEO'],
        ['CEO', 'CTO'],
        ['CEO', 'CPO'],
        ['CEO', 'CSO'],
        ['CEO', 'CMO'],
        ['CEO', 'HR'],
        ['CTO', 'Product'],
        ['CTO', 'Web'],
        ['CSO', 'Sales'],
        ['CMO', 'Market']
    ],
    levels: [{
        level: 0
        dataLabels: {
        style: {
            fontSize: '30px'
        }
       }
        }],
    dataLabels: {
        style: {
            fontSize: '30px'
        }
    }
  }]
})
  • Inside the serie系列里面
  • In a level在一个级别
  • Globally全球范围内

Any idea?任何想法?

Anothers styles like "color" or "fontFamily" does work另一个 styles 像“color”或“fontFamily”确实有效

The fontSize defined for each particular level or defined for the whole series works fine, even using em unit.为每个特定级别定义或为整个系列定义的fontSize工作正常,即使使用em单位。

Demo: https://jsfiddle.net/BlackLabel/voz3btL1/演示: https://jsfiddle.net/BlackLabel/voz3btL1/

levels: [{
  level: 0,
  dataLabels: {
    style: {
      fontSize: '4em'
    }
  }
}],

API: https://api.highcharts.com/highcharts/series.organization.dataLabels.style.fontSize API: https://api.highcharts.com/highcharts/series.organization.dataLabels.style.fontSize

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

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