当前位置:网站首页>29. Learn the stacked column chart of highcharts using percentage
29. Learn the stacked column chart of highcharts using percentage
2022-07-27 23:45:00 【Microservice mall technology sharing】
Highcharts Stacked column chart using percentage
The following example demonstrates stacked column charts using percentages .
We've learned in the previous chapters Highcharts Basic configuration syntax . Next, let's look at other configurations . stay plotOptions Add stacking attribute :

To configure
plotOptions: Data point options
plotOptions It is used to set the related properties of data points in the chart .plotOptions According to various chart types , The property settings are slightly different .
Configure chart stack settings plotOptions.area.stacking by "percent". If stack use is disabled null.
var plotOptions = {
column: {
stacking: 'percent'
}
};example
file name :highcharts_column_percentage.htm
<html>
<head>
<meta charset="UTF-8" />
<title>Highcharts course | xx course (xxxxxx.com)</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
<script language="JavaScript">
$(document).ready(function() {
var chart = {
type: 'column'
};
var title = {
text: ' Stacked Columns '
};
var xAxis = {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
};
var yAxis ={
min: 0,
title: {
text: ' Total fruit consumption '
}
};
var tooltip = {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
shared: true
};
var plotOptions = {
column: {
stacking: 'percent'
}
};
var credits = {
enabled: false
};
var series= [{
name: 'John',
data: [5, 3, 4, 7, 2]
}, {
name: 'Jane',
data: [2, 2, 3, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5]
}];
var json = {};
json.chart = chart;
json.title = title;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.tooltip = tooltip;
json.plotOptions = plotOptions;
json.credits = credits;
json.series = series;
$('#container').highcharts(json);
});
</script>
</body>
</html>The output of the above example is :

边栏推荐
- js数组复制速度测试220320
- 图基本知识代码
- Flutter pull_to_refresh-1.6.0/lib/src/internals/slivers.dart:164:13: Error: Method not found: ‘descr
- urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
- 详解分布式系统的幂等
- JUC toolkit learning
- 请求合并哪家强——接口请求合并的3种技巧,性能直接爆表
- Winform怎么使用FTP实现自动更新
- 总投资600亿!富士康半导体高端封测项目正式落户青岛
- 小程序容器技术超有料,可以让移动研发效率大幅提升
猜你喜欢
随机推荐
CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
一加将在2020年释放ODM订单,发力中低端市场
硬布线控制器的特点:
Tita 的OKR系统与其他同类型产品,或者是共享文档等相比,有什么优势?
The share price soared 180.46%! Shanghai silicon industry, the leader of domestic large silicon wafers, is listed: the cumulative net profit in recent four years is less than 60million
[image detection] realize the detection of nostrils and pupil circles based on combined separation filter matlab source code
Apple releases new iPhone se: equipped with A13 bionic processor, priced from 3299 yuan
Lua basic grammar learning
RPA流程自动化机器人是什么技术?如何实现办公自动化?
Accelerate IGBT localization! BYD semiconductor will be listed independently, with a market value of 30billion yuan!
reduce错误示范
NDK series (6): let's talk about the way and time to register JNI functions
解决5G使用痛点,魅族17 mSmart 5G快省稳技术发布
Winform怎么使用FTP实现自动更新
Interviewer: let's talk about the specific process of network data transmission
用户画像在科技期刊微信公众号精准推送中的应用
常用泰勒展开
日产1500万只!比亚迪口罩拿下美国加州10亿美元订单
台积电3nm细节曝光:晶体管密度高达2.5亿个/mm²,性能及能效大幅提升
NDK 系列(6):说一下注册 JNI 函数的方式和时机








