Basic Area in JavaScript
Using ApexCharts with JavaScript
This Basic Area example uses ApexCharts.js directly in JavaScript, with no wrapper component.
Install it with npm install apexcharts, then mount the chart with new ApexCharts(element, options).render().
var options = {
series: [
{
name: 'Share Price',
data: series.monthDataSeries1.prices,
},
],
chart: {
type: 'area',
height: 350,
zoom: {
enabled: false,
},
},
dataLabels: {
enabled: false,
},
stroke: {
curve: 'straight',
},
title: {
text: 'Meridian Corp Share Price',
align: 'left',
},
subtitle: {
text: 'Daily close, last quarter',
align: 'left',
},
labels: series.monthDataSeries1.dates.map(function (d) {
return d.replace('2017', '2025')
}),
xaxis: {
type: 'datetime',
},
legend: {
horizontalAlign: 'left',
},
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()