如何使我的一系列轴与更高座的宽度一样正常?

发布于 2025-01-17 14:45:28 字数 2246 浏览 3 评论 0 原文

如何使我的图表看起来正常。我进行了搜索,但没有找到任何相关结果。请帮帮我。 我的图表图像

我怎样才能使数据代表线的正常宽度,因为它们是如此“薄” ”并且还请告诉我如何删除“条形”中间的“0%”,

我认为由于这些数据,我的图表无法正确显示。但应该如何传递数据。下面你可以看到我的数据


categories: [
  'Energy',
  'Real Estate',
  'Information Technology',
  'Financials',
  'Healthcare',
  'Consumer Discretionary',
  'Materials',
  'Communication Services',
  'Industrials',
  'Consumer Staples',
  'Utilities',
],
series: [{
    name: 'Energy',
    data: [59.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#385723',
    width: 6,
    dataLabels: {
      color: '#385723',
    },
  }, {
    name: 'Real Estate',
    data: [0, 56.4, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#385723',
    dataLabels: {
      color: '#385723',
    },
  }, {
    name: 'Information Technology',
    data: [0, 0, 37.1, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Financials',
    data: [0, 0, 0, 35.1, 0, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Healthcare',
    data: [0, 0, 0, 0, 26.9, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Consumer Discretionary',
    data: [0, 0, 0, 0, 0, 21.7, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Materials',
    data: [0, 0, 0, 0, 0, 0, 13.7, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Communication Services',
    data: [0, 0, 0, 0, 0, 0, 0, 7.8, 0, 0, 0],
    color: '#A9D18E',
    dataLabels: {
      color: '#A9D18E',
    },
  }, {
    name: 'Industrials',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 6.4, 0, 0],
    color: '#C5E0B4',
    dataLabels: {
      color: '#C5E0B4',
    },
  }, {
    name: 'Consumer Staples',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 0, -1.2, 0],
    color: '#F8CBAD',
    dataLabels: {
      color: '#F8CBAD',
    },
  }, {
    name: 'Utilities',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5],
    color: '#F4B183',
    dataLabels: {
      color: '#F4B183',
    },
  },
],

how to make my graph looks normal. I searched but I didn't find any relevant result. please help me out. my graph image

how can I make the data represent line's to normal width as they are so "thin" and also please tell me how to remove "0%" at middle of "bar"

I think because of this data my graph not showing properly. But how should pass data. Here below you can see my data


categories: [
  'Energy',
  'Real Estate',
  'Information Technology',
  'Financials',
  'Healthcare',
  'Consumer Discretionary',
  'Materials',
  'Communication Services',
  'Industrials',
  'Consumer Staples',
  'Utilities',
],
series: [{
    name: 'Energy',
    data: [59.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#385723',
    width: 6,
    dataLabels: {
      color: '#385723',
    },
  }, {
    name: 'Real Estate',
    data: [0, 56.4, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#385723',
    dataLabels: {
      color: '#385723',
    },
  }, {
    name: 'Information Technology',
    data: [0, 0, 37.1, 0, 0, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Financials',
    data: [0, 0, 0, 35.1, 0, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Healthcare',
    data: [0, 0, 0, 0, 26.9, 0, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Consumer Discretionary',
    data: [0, 0, 0, 0, 0, 21.7, 0, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Materials',
    data: [0, 0, 0, 0, 0, 0, 13.7, 0, 0, 0, 0],
    color: '#548235',
    dataLabels: {
      color: '#548235',
    },
  }, {
    name: 'Communication Services',
    data: [0, 0, 0, 0, 0, 0, 0, 7.8, 0, 0, 0],
    color: '#A9D18E',
    dataLabels: {
      color: '#A9D18E',
    },
  }, {
    name: 'Industrials',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 6.4, 0, 0],
    color: '#C5E0B4',
    dataLabels: {
      color: '#C5E0B4',
    },
  }, {
    name: 'Consumer Staples',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 0, -1.2, 0],
    color: '#F8CBAD',
    dataLabels: {
      color: '#F8CBAD',
    },
  }, {
    name: 'Utilities',
    data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5],
    color: '#F4B183',
    dataLabels: {
      color: '#F4B183',
    },
  },
],

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半枫 2025-01-24 14:45:28

您需要禁用分组

plotOptions: {
    series: {
        grouping: false
    }
}

实时演示:

api参考: https://api.highcharts.com/highcharts/plotoptions.bar.grouping

You need to disable grouping:

plotOptions: {
    series: {
        grouping: false
    }
}

Live demo: http://jsfiddle.net/BlackLabel/osvje9uz/

API Reference: https://api.highcharts.com/highcharts/plotOptions.bar.grouping

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文