charts - Charts from user input
问题描述
hi i want to modify this chart values by user input , but i have problems by getting array value from user input . when i`m trying to assing a variable to array chart is not getting it. i tried
This is my code
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Ab', 'Vanzari', 'Cheltuieli', 'Profit'],
['2018', 1000, 400, 200],
['2019', 1170, 460, 250],
['2020', 660, 1120, 300],
['2021', 1030, 540, 350]
]);
var options = {
chart: {
title: 'Performanta Firmei',
subtitle: 'Vanzari, Cheltuieli, Si Profit Profit: 2018-2021',
}
};
var chart = new google.charts.Bar(document.getElementById('columnchart_material'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
</script>
</head>
<body>
<div id="columnchart_material" style="width: 800px; height: 500px;"></div>
</body>
</html>
</main>
<?php include("includes/sidebar.php")?>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script src="script.js"></script>
</body>
解决方案
推荐阅读
- c# - 通过DCOM从C#中的C++中检索字符串数组
- python - Blob input binding with Azure Function in Python is not working (inputblob.name is None"). How to troubleshoot?
- r - R:如何重载 + 运算符来调用将函数添加到 R6 类的方法?
- mysql - Sql查询查找具有最大里程的汽车
- javascript - 点击destroy with cocoon后,如何在不销毁记录的情况下重新计算发票
- arrays - 我可以在 MongoDB 文档中修改数组的值,但它不会在数据库中更新
- javascript - 从未定义的数组值映射的反应按钮
- uiviewcontroller - iOS 13 PageSheet 父 UIViewController 不会变黑
- javascript - HTML字符串格式化函数算法的问题
- r - 有没有人可以使用 R 解释基本正则表达式的结果?