简体   繁体   English

如何从MySQL数据库创建图表

[英]How to create chart from mysql database

i have this table in mysql : this is my mysql table to make you better understand the use case and why i still did not find answer on the web 我在mysql中有此表: 这是我的mysql表,可让您更好地了解用例以及为什么我仍然在网上找不到答案

how can i create three separate chart using the table. 如何使用表格创建三个单独的图表。 In this case, it will be three chart which is male chart, female chart and other chart. 在这种情况下,将是三个图表,即男性图表,女性图表和其他图表。 in each chart i want to show how much male select orange, how much select apple, banana and grape. 在每个图表中,我想显示多少男性选择橙子,多少选择苹果,香蕉和葡萄。 same goes to other chart . 其他图表也一样

my search always brought me to something that being preset with value to create the chart, which i think it is straightforward. 我的搜索总是带给我一些预先设置值以创建图表的功能,我认为这很简单。 Does anyone know how to do this? 有谁知道如何做到这一点? your help is appreciated. 感谢您的帮助。

p/s: i already read those question that already being asked as what i said most of them are preset value. p / s:我已经读过那些已经被问到的问题,因为我说的大多数都是预设值。

Since your question to general, here is the steps you need to do 既然您的问题很笼统,这就是您需要执行的步骤

  1. include chart library file such as fusion chart libraries 包括图表库文件,例如融合图表库
  2. make sure you're connected to your mysql database 确保您已连接到mysql数据库
  3. write a query and return it as json data 编写查询并将其作为json数据返回
  4. create chart container to render it in html page 创建图表容器以在html页面中呈现
  5. you are done 你完成了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM