当前位置:网站首页>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 :

边栏推荐
- 日产1500万只!比亚迪口罩拿下美国加州10亿美元订单
- Using the optical fingerprint scheme under the huiding screen, Samsung Galaxy a71 5g is listed
- 2022/7/26
- 采用汇顶屏下光学指纹方案,三星Galaxy A71 5G上市
- 字符流学习14.3
- sort排序
- urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
- Introduction to several common usage scenarios of message queue
- 2022 summer vacation daily question (5)
- What technology is RPA process automation robot? How to realize office automation?
猜你喜欢

Explain the idempotence of distributed system in detail

怎么使用C# Winform实现复制文件显示进度

Starfish Os X MetaBell战略合作,元宇宙商业生态更进一步

一位软件投资者的独白:我为什么不追逐快速增长的公司
![[C language] address book (dynamic version)](/img/29/3df19c187bee31ee4671e12d7cc7ff.jpg)
[C language] address book (dynamic version)

iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成

The print version of imeta | international standard ISSN is officially confirmed, and the application for dual ISSN is completed

Introduction to several common usage scenarios of message queue

File & recursion 14.1

JUC toolkit learning
随机推荐
Software test function test full set of common interview questions [function test] interview summary 4-2
Starfish Os X MetaBell战略合作,元宇宙商业生态更进一步
7.6万人停工!东芝宣布关闭日本所有工厂
怎么使用xshell免费版
Flink怎么使用Savepoint
The txt file named according to the sequence number is renamed from the back to the front
Normality of confidence interval
iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成
置信区间之正态
CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
详解分布式系统的幂等
The total investment is 60billion! Foxconn semiconductor high-end package test project officially settled in Qingdao
2019年全球十大半导体厂商:英特尔重回第一,苹果逆势大涨
Socket interaction process of three handshakes
Arm32进行远程调试
Calling dht11/22 temperature and humidity sensor in Proteus simulation Arduino
请求合并哪家强——接口请求合并的3种技巧,性能直接爆表
In 2019, the world's top ten semiconductor manufacturers: Intel returned to the first place, and apple rose sharply against the trend
[JS reverse hundred examples] a public resource trading network, reverse analysis of announcement URL parameters
重新定义分析 - EventBridge 实时事件分析平台发布