<!DOCTYPE html> <html lang="zh" > <head> <meta charset="UTF-8"> <title>Apexcharts - fill.gradient</title> </head> <body> <div id="chart"></div> <script src="https://cdn.bootcdn.net/ajax/libs/apexcharts/3.35.0/apexcharts.min.js"></script> </body> </html>
#chart { max-width: 650px; margin: 35px auto; }
var options = { chart: { height: 280, type: "area" }, dataLabels: { enabled: false }, series: [ { name: "Series 1", data: [45, 52, 38, 45, 19, 23, 2] } ], fill: { type: "gradient", gradient: { shadeIntensity: 1, opacityFrom: 0.7, opacityTo: 0.9, stops: [0, 90, 100] } }, xaxis: { categories: [ "01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan" ] } }; var chart = new ApexCharts(document.querySelector("#chart"), options); chart.render();