我用chart.js 创建了一个图表。这个图有两条线。所以它默认也显示两个标签。但是我需要一种配置,例如应该出现红色标签而应该隐藏蓝色标签。标签不是线!!
谢谢你的帮助
var config = {
type: 'line',
data: {
labels: ['16:30', '17:30', '18:30', '19:30', '20:30'],
datasets: [{
label: 'High',
backgroundColor: 'blue',
borderColor: 'blue',
data: [10.43, 10.42, 10.44, 10.43, 10.40],
fill: false,
}, {
label: 'low',
fill: false,
backgroundColor: 'red',
borderColor: 'red',
data: [8.43, 8.5, 8.39, 8.38, 8.38],
}]
},
options: {
responsive: true,
title: {
display: true,
text: 'Test'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: { …Run Code Online (Sandbox Code Playgroud)我尝试在引导卡(覆盖卡)的右上角设置图像。我将图像定位在绝对位置。我认为这就是问题所在。如果更改屏幕尺寸,则图像位于旧位置,但卡已移动。即使更改屏幕尺寸,如何将图像固定在角落?
谢谢!
#hat {
width: 50px;
height: 50px;
position: absolute;
left: 420px;
top: -25px;
z-index: 100;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid mt-2">
<div class="row justify-content-center">
<div class="col-md-7 col-lg-8 col-xl-7 mt-md-5">
<div id="santabox">
<img id="hat" src="https://via.placeholder.com/50" alt="hat">
<div class="card mb-4">
<div class="card-header text-center">
<h3>
Text
</h3>
</div>
<div class="card-body">
<p>Text</p>
</div>
</div>
</div>
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)