【发布时间】:2021-09-25 17:57:26
【问题描述】:
当我尝试ApexCharts Column with Markers 的演示代码时,我无法显示“标记”。想不通为什么。假设它可能会结束。需要在此处添加更多文本,但它们也提供了 Angular、React 和 Vue 的演示,这些似乎有效(没有尝试过 Vue 的)。我还检查了文档,但找不到任何内容。
var options = {
series: [
{
name: "Actual",
data: [
{
x: "2011",
y: 1292,
goals: [
{
name: "Expected",
value: 1400,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2012",
y: 4432,
goals: [
{
name: "Expected",
value: 5400,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2013",
y: 5423,
goals: [
{
name: "Expected",
value: 5200,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2014",
y: 6653,
goals: [
{
name: "Expected",
value: 6500,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2015",
y: 8133,
goals: [
{
name: "Expected",
value: 6600,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2016",
y: 7132,
goals: [
{
name: "Expected",
value: 7500,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2017",
y: 7332,
goals: [
{
name: "Expected",
value: 8700,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
{
x: "2018",
y: 6553,
goals: [
{
name: "Expected",
value: 7300,
strokeWidth: 5,
strokeColor: "#775DD0",
},
],
},
],
},
],
chart: {
height: 350,
type: "bar",
},
plotOptions: {
bar: {
columnWidth: "60%",
},
},
colors: ["#00E396"],
dataLabels: {
enabled: false,
},
legend: {
show: true,
showForSingleSeries: true,
customLegendItems: ["Actual", "Expected"],
markers: {
fillColors: ["#00E396", "#775DD0"],
},
},
};
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
【问题讨论】:
标签: javascript apexcharts