我正在使用的图表JS图表与类型栏,并试图创建重叠的酒吧。它必须是3酒吧为一个日期,互相重叠。想法:
有一个正确顺序,但它适用于所有的小节集,所以一些小节可以完全重叠在另一个小节上。是否可以使用chartJS?或者我应该使用另一个库?x1c 0d1x的数据
omvjsjqw1#
你可以用highchart,有很多变化你可以尝试这里有一个这样的例子:
Highcharts.chart('container', { chart: { type: 'column' }, title: { text: 'A basic column chart', align: 'left' }, xAxis: { categories: ['USA', 'China', 'Brazil', 'EU', 'India', 'Russia'], crosshair: true, accessibility: { description: 'Countries' } }, yAxis: { min: 0, title: { text: '1000 metric tons (MT)' } }, tooltip: { valueSuffix: ' (1000 MT)' }, plotOptions: { column: { borderWidth: 0, stacking: "overlap" } }, series: [ { name: 'Corn', data: [406292, 260000, 55000, 68300, 27500, 14500] }, { name: 'Wheat', data: [51086, 136000, 107000, 141000, 107180, 77000] } ]});
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'A basic column chart',
align: 'left'
xAxis: {
categories: ['USA', 'China', 'Brazil', 'EU', 'India', 'Russia'],
crosshair: true,
accessibility: {
description: 'Countries'
}
yAxis: {
min: 0,
text: '1000 metric tons (MT)'
tooltip: {
valueSuffix: ' (1000 MT)'
plotOptions: {
column: {
borderWidth: 0,
stacking: "overlap"
series: [
{
name: 'Corn',
data: [406292, 260000, 55000, 68300, 27500, 14500]
name: 'Wheat',
data: [51086, 136000, 107000, 141000, 107180, 77000]
]
});
.highcharts-figure,.highcharts-data-table table { min-width: 310px; max-width: 800px; margin: 1em auto;}#container { height: 400px;}.highcharts-data-table table { font-family: Verdana, sans-serif; border-collapse: collapse; border: 1px solid #ebebeb; margin: 10px auto; text-align: center; width: 100%; max-width: 500px;}.highcharts-data-table caption { padding: 1em 0; font-size: 1.2em; color: #555;}.highcharts-data-table th { font-weight: 600; padding: 0.5em;}.highcharts-data-table td,.highcharts-data-table th,.highcharts-data-table caption { padding: 0.5em;}.highcharts-data-table thead tr,.highcharts-data-table tr:nth-child(even) { background: #f8f8f8;}.highcharts-data-table tr:hover { background: #f1f7ff;}
.highcharts-figure,
.highcharts-data-table table {
min-width: 310px;
max-width: 800px;
margin: 1em auto;
#container {
height: 400px;
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #ebebeb;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: #555;
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
.highcharts-data-table tr:hover {
background: #f1f7ff;
<script src="https://code.highcharts.com/highcharts.js"></script><script src="https://code.highcharts.com/modules/exporting.js"></script><script src="https://code.highcharts.com/modules/export-data.js"></script><script src="https://code.highcharts.com/modules/accessibility.js"></script><figure class="highcharts-figure"> <div id="container"></div></figure>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
</figure>
您可以在API指南中探索许多选项,并根据需要进行调整https://api.highcharts.com/highcharts/global希望能帮上忙。
1条答案
按热度按时间omvjsjqw1#
你可以用highchart,有很多变化你可以尝试
这里有一个这样的例子:
您可以在API指南中探索许多选项,并根据需要进行调整https://api.highcharts.com/highcharts/global
希望能帮上忙。