for this purpose, unfortunately, I cant find my way yet using views or this module http://drupal.org/project/views_groupby (it doesnt work when using date published field even using field rewrite).
so here is a snippet I wrote that can be pasted in a block (you need php input).
this generates a table with 3 columns : year/month, node created / month, total (cumulative). change the nod type and drupal table preffix by yours.
<?php
$header = array('month','compte','total');
$rows = array();
$total = 0;
$query = "SELECT
DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 3600 SECOND), '%Y/%m') AS node_created_month,
COUNT(node.nid) AS node_count
FROM <db>_node node
WHERE node.type in ('<nodetype>')
GROUP BY node_created_month
ORDER BY node_created_month ASC";
$results = db_query($query);
while ($fld = db_fetch_object($results)) {
$total += $fld->node_count;
$rows[] = array(
$fld->node_created_month,
$fld->node_count,
$total
);
}
return theme('table', $header, $rows);
?>
using the google chart api module http://drupal.org/project/chart
one can also generate a chart using the same query.
<?php
// retrieve datas
$query = "SELECT
DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 3600 SECOND), '%Y/%m') AS node_created_month,
COUNT(node.nid) AS node_count
FROM <db>_node node
WHERE node.type in ('<nodetype>')
GROUP BY node_created_month
ORDER BY node_created_month ASC";
$results = db_query($query);
// prepare chart layout
$chart = array(
'#chart_id' => 'test_chart',
'#title' => chart_title(t('blahblah'), 'cc0000', 15),
'#type' => CHART_TYPE_LINE,
'#size' => chart_size(545, 300),
'#adjust_resolution' => TRUE,
'#chart_fill' => chart_fill('c', 'eeeeee'),
'#grid_lines' => chart_grid_lines(20, 20, 1, 5),
);
$chart['#legends'][] = '<nodetype>';
$chart['#data_colors'][] = '00ff00';
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][1][] = chart_mixed_axis_label(t('nombre lieux'), 50);
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][2][] = chart_mixed_axis_label(t('temps'), 50);
// inject datas into chart arrays
$total = 0;
while ($fld = db_fetch_object($results)) {
$total = $total + $fld->node_count;
$chart['#data']['<nodetype>'][] = $total;
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label( $fld->node_created_month );
};
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][0][] = chart_mixed_axis_range_label(0, $total);
echo chart_render($chart);
?>
the generated graph png can be saved, and block is cachable so I wonder if its valuable to investigate about cron and add results to an existing sql table rather than to regenerate the whole thing, but well, that's a start.