【发布时间】:2018-04-03 11:31:10
【问题描述】:
我有这张project 表,你可以在下面看到,从下表中我想制作一个图表,其中包含该月有多少project
id | project_name | start_date |
1 | proj1 | 2017-09-01 |
2 | proj2 | 2017-09-01 |
3 | proj3 | 2017-09-01 |
4 | proj4 | 2017-08-01 |
5 | proj5 | 2017-08-01 |
到目前为止我所做的是制作一个模型,然后我很困惑下一步我应该做什么,因为我创建的模型不是动态的,它只读取某个月份,在这种情况下是 month=@ 987654327@
public function get_monthly_totals($theYear = '', $theMonth = '')
{
$select = "
SELECT COUNT(*) AS start_count
FROM
project
WHERE
MONTH(start_date)=09";
return $this->db->query($select);
}
我想制作一个像上面这样的图表,我使用的插件是 highcharttable 它将html表格数据转换为图表,我如何制作这样的东西,我如何制作一个月即使没有数据也存在,以及如何将数据连接到正确的月份?
【问题讨论】:
标签: php mysql codeigniter charts highcharts