Basic Slope in JavaScript
Using ApexCharts with JavaScript
This Basic Slope 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: 'Platform',
data: [
{
x: 'Q1',
y: 43,
},
{
x: 'Q2',
y: 58,
},
],
},
{
name: 'Mobile',
data: [
{
x: 'Q1',
y: 33,
},
{
x: 'Q2',
y: 38,
},
],
},
{
name: 'Web',
data: [
{
x: 'Q1',
y: 55,
},
{
x: 'Q2',
y: 21,
},
],
},
],
chart: {
height: 350,
width: 400,
type: 'line',
},
plotOptions: {
line: {
isSlopeChart: true,
},
},
title: {
text: 'Sprint Velocity: Q1 to Q2',
},
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()