我尝试使用 Tui 图表创建一个基本示例,但似乎缺少依赖项。这真的是问题吗?如果是,是哪个依赖项?
我已经包含了以下库:
https://uicdn.toast.com/tui.chart/latest/tui-chart.min.css
https://uicdn.toast.com/tui.chart/latest/tui-chart.min.js
https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.js
var container = document.getElementById('chart-area');
var data = {
categories: [
'Monday (2 Apr)',
'Tuesday (3 Apr)',
'Wednesday (4 Apr)',
'Thursday (5 Apr)',
'Friday (6 Apr)',
'Saturday (7 Apr)',
'Sunday (8 Apr)'
],
series: [
{
name: 'Activity',
data: [8, 8.5, 7.8, 6.5, 8, 0, 0]
}
]
};
var options = {
chart: {
width: 1160,
height: 650,
title: 'Activities',
format: function(value, chartType, areaType, valuetype, legendName) {
var formattedValue = value + "h";
return formattedValue;
}
},
yAxis: {
title: 'Hours'
},
xAxis: {
title: 'Days'
},
legend: {
// hide the legend
visible: false
},
series: {
// always show the value on top of each column
showLabel: true
}
};
var theme = {
series: {
colors: [
'#83b14e', '#458a3f', '#295ba0', '#2a4175', '#289399',
'#289399', '#617178', '#8a9a9a', '#516f7d', '#dddddd'
]
}
};
tui.chart.columnChart(container, data, options);