score:0
I manage to do it by doing something like this in my controller, I know it's not beautiful but it is fine for now
public function dashboard_project()
{
$thn = $this->input->post('tahun');
$id = md5($this->session->userdata('id'));
$data['rows'] = $this->pengguna_m->getPengguna($id)->row();
$data['januari'] = $this->dashboard_m->get_kategori_totals('01',$thn)->num_rows();
$data['februari'] = $this->dashboard_m->get_kategori_totals('02',$thn)->num_rows();
$data['maret'] = $this->dashboard_m->get_kategori_totals('03',$thn)->num_rows();
$data['april'] = $this->dashboard_m->get_kategori_totals('04',$thn)->num_rows();
$data['mei'] = $this->dashboard_m->get_kategori_totals('05',$thn)->num_rows();
$data['juni'] = $this->dashboard_m->get_kategori_totals('06',$thn)->num_rows();
$data['juli'] = $this->dashboard_m->get_kategori_totals('07',$thn)->num_rows();
$data['agustus'] = $this->dashboard_m->get_kategori_totals('08',$thn)->num_rows();
$data['september'] = $this->dashboard_m->get_kategori_totals('09',$thn)->num_rows();
$data['november'] = $this->dashboard_m->get_kategori_totals('10',$thn)->num_rows();
$data['oktober'] = $this->dashboard_m->get_kategori_totals('11',$thn)->num_rows();
$data['desember'] = $this->dashboard_m->get_kategori_totals('12',$thn)->num_rows();
$data['title']= 'Aplikasi Saranabudi';
$data['aktif'] = 'Jumlah Kategori Project';
$data['judul_hal']= 'Dashboard Kategori Project';
$this->load->view('layout/header',$data);
$this->load->view('layout/sidebar',$data);
$this->load->view('dashboard/pelanggan/home');
$this->load->view('layout/footer');
}
score:0
Here's my simple syntax to count per month within a year
public function get_monthly_totals($theYear = ''){
$select = "
SELECT
COUNT(*) AS start_count,
MONTH(start_date) as month
FROM
project
WHERE
YEAR(start_date)='$theYear'
GROUP BY
MONTH(start_date)
";
return $this->db->query($select);
}
Source: stackoverflow.com
Related Query
- Codeigniter highcharttable count how many data in a month
- Data with timestamp group to month(like Jan, Feb, March) and showing as total count for month in Highcharts
- How to show count of data in pie-chart in chartkick rails
- Is there a limit to how many data plots you can have on a highcharts graph
- How to have multiple highcharts with different series data in vuejs without repeating code
- how to COUNT explode imploding data with comma?
- How do I buffer streamed data with react-hooks (useEffect) to be able to update another component at once to avoid many rerenderings?
- how do i link my sqlite(PDO) databse data to highcharts code
- How to render Gantt Highchart from data source
- How to change value with count data
- How to add the years in xAxis date format while exporting? Also how to add the data source during the exporting?
- How to format data labels with Jquery Highcharttable column charts
- How do I hide the code for the chart data in highcharts?
- how to hide highchart x - axis data values
- How to make highcharts default to 0 for missing data
- How to show No Data Available Message in highcharts
- How to get multiple series data in tooltip highcharts?
- How to display No Data Available Message in highcharts
- Highcharts How to Show Loading Animation At Set Data
- How do I dynamically change a data point in Highcharts using JavaScript
- How to make stacked column graph to show total data value on top
- how to set dynamic data in highcharts
- How to pass json data to highcharts series?
- How to set PointIntervals per month in HighChart
- How to display highchart y axis with constistant data
- Highstock: When legend under the chart has many items, the chart height is small. How can I fix the height?
- Highcharts how to use JavaScript variable as series data source?
- Highcharts: How do I set dynamic data to the drilldown pie chart?
- How to get multiple data series into Highcharts
- How to pass custom data into Highcharts graph click event
More Query from same tag
- How to disable click in angular high-chart data points?
- If Array is Empty PHP - Highcharts
- Highchart multiple-color line series dynamically
- How can I ensure my Highcharts don't break my flexbox layout?
- resizing multiple highcharts in a table
- Highcharts word cloud - Make a link to each word
- Highchart Treemap colorindex for fixed color values
- Getting the complete XML source out of an XML DOM object
- Number of pie slices in highcharts
- Highcharts exporting functionality not working in latest release
- Highcharts Stacking Bar misaligned and oddly sized bars
- HighCharts - Permanent tooltip on solid gauge
- Highcharts dynamically restrict dragging limits
- Highcharts + Highslide: When opening a new highslide popup or clicking anywhere else, close any previously opened popups
- Reverse highmaps legend values or color OR draw legend color from other attribute instead of value in series
- Highcharts: "Print all" button
- high chart label outside of view
- Highstock tooltip 'a tag' doesn't get rendered
- put the highchart legend to the bottom of the chart and horizontally centered
- Divide X axis by Clickable Zones in HIghchart
- Is there a better way to (Un)select all LegendItems in HighCharts LineChart?
- Highcharts stacked column chart is missing some values?
- highcharts find point with given x value
- Highcharts and the export of table data
- Use a variable for Highcharts yAxis.Max
- ASP.NET WebRequest to Highcharts export server
- How can I generate a real-time highchart from my database data?
- Highcharts - toggle auto scale
- hide specific point in a HighCharts scatterplot
- Timezone on Highcharts