var options = {
series: [{
name: 'Рост',
data: topcoins, # здесь хочу подставить массив с числами
}],
chart: {
height: 350,
type: 'bar',
},
plotOptions: {
bar: {
borderRadius: 10,
dataLabels: {
position: 'top', // top, center, bottom
},
}
},
dataLabels: {
enabled: true,
formatter: function (val) {
return val + "%";
},
offsetY: -20,
style: {
fontSize: '12px',
colors: ["#304758"]
}
},
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
position: 'top',
axisBorder: {
show: false
},
axisTicks: {
show: false
},
crosshairs: {
fill: {
type: 'gradient',
gradient: {
colorFrom: '#D8E3F0',
colorTo: '#BED1E6',
stops: [0, 100],
opacityFrom: 0.4,
opacityTo: 0.5,
}
}
},
tooltip: {
enabled: true,
}
},
yaxis: {
axisBorder: {
show: false
},
axisTicks: {
show: false,
},
labels: {
show: false,
formatter: function (val) {
return val + "%";
}
}
},
title: {
text: 'Текст графика',
floating: true,
offsetY: 330,
align: 'center',
style: {
color: '#444'
}
}
};
var chart = new ApexCharts(document.querySelector("#topcoins"), options);
chart.render();
Array
(
[0] => 124
[1] => 38
[2] => 38
[3] => 31
[4] => 27
[5] => 22
[6] => 20
[7] => 18
[8] => 18
[9] => 16
[10] => 14
[11] => 14
)
CREATE TABLE `platform` (
`id` int(8) NOT NULL,
`ticker` varchar(16) NOT NULL,
`lastprice` double NOT NULL,
`pricechange` double NOT NULL,
`pricechangepercent` float NOT NULL,
`highprice` double NOT NULL,
`lowprice` double NOT NULL,
`volume` double NOT NULL,
`quoteVolume` float NOT NULL,
`spread` float NOT NULL,
`time` varchar(22) NOT NULL,
UNIQUE KEY `ticker` (`ticker`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8