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

边栏推荐
- 置信区间之正态
- 图基本知识代码
- Application of user portrait in precise push of wechat official account of scientific journals
- [number recognition] handwritten number recognition based on knowledge base with matlab code
- What are the advantages of Tita's OKR system over other similar products or shared documents?
- Redis distributed lock
- Tita 的OKR系统与其他同类型产品,或者是共享文档等相比,有什么优势?
- 进制转换方法
- What is the difference between concurrency and parallelism?
- 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
猜你喜欢

The technology of applet container is very promising, which can greatly improve the efficiency of mobile R & D

Date的使用

远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug

CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021

File & recursion 14.1

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

Explain the idempotence of distributed system in detail

Interviewer: let's talk about the specific process of network data transmission

西门子PLC能否实时无线采集多处从站模拟量数据?

Exercise --- BFS
随机推荐
File & recursion 14.1
软件测试功能测试全套常见面试题【功能测试】面试总结4-2
Key points of data management
数据管理的重点
76000 people shut down! Toshiba announced the closure of all factories in Japan
2019年全球十大半导体厂商:英特尔重回第一,苹果逆势大涨
Elk log analysis system installation and deployment
怎么使用xshell免费版
RPA流程自动化机器人是什么技术?如何实现办公自动化?
TFRecord的Shuffle、划分和读取
Nature综述:微生物群落形成过程中的优先效应
MySQL data query (where)
org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.
消息队列常见的几种使用场景介绍
常用泰勒展开
详解分布式系统的幂等
CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
Redis distributed lock
iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成
After returning to mixlab for three days, "creative team" cured my spiritual internal friction