我正在使用按列高圖分組。例如:https: //jsfiddle.net/2bvudw1m/有沒有一種方法可以顯示代表列的計數y(在列系列的頂部)和數據標簽名稱(在底部)的數據標簽?例如:這是我的系列數據:series: [{ name: 'active', data: [53, 33, 43, 63, 7, 83], dataLabels: { enabled: true, verticalAlign: 'bottom', overflow: 'none', crop: false, y: 20, formatter() { return this.series.userOptions.name; } } }, { name: 'new', data: [33, 43, 43, 63, 73, 8], }]我想展示兩件事:計數代表每個系列該系列的 DataLabel到目前為止我有這個: $(function() { $('#container').highcharts({ chart: { type: 'column', }, title: { text: 'Total fruit consumtion, grouped by gender' }, xAxis: { categories: ['Apples', 'Oranges', 'Apples2', 'Oranges2','Apples3', 'Apple33'], offset: 30 }, yAxis: { allowDecimals: false, //offset:10, title: { text: 'Number of fruits' }, stackLabels: { enabled: true, verticalAlign: 'top', } }, plotOptions: { series: { dataLabels: { enabled: true, formatter: function() { return this.y; } } }, column: { stacking: '' }, }, series: [{ name: 'active', data: [53, 33, 43, 63, 7, 83], dataLabels: { enabled: true, verticalAlign: 'bottom', overflow: 'none', crop: false, y: 20, formatter() { return this.series.userOptions.name; } } }, { name: 'new', data: [33, 43, 43, 63, 73, 8], } ] }); });https://jsfiddle.net/nec89t56/2/但是,這不起作用,因為當我嘗試添加兩個值時,它會添加計數y或名稱。有沒有一種方法可以同時添加列grouped: true和stacking: ""注意:我不能像“正?!蹦菢佣询B,因為它會堆疊而不是分組,這不是我想要的。有任何想法嗎?
在柱形圖上顯示數據標簽(總計和數據標簽名稱)- ReactJs highcharts
森欄
2023-05-25 16:58:56