Views charts with node revision date as x-axis I have 4 nodes with a field status (just an example, it could have more fields). The content type is set to create revisions on every update.

What I need is to create a chart in views like the one below, using Charts and Highcharts.



So, first time I create the 4 nodes:


3 have status = No Run;
1 have status = Blocked;


After updating the 4 nodes, a new revision is created and now each node has a different status value:


1 have status = No Run;
1 have status = Blocked;
1 have status = Passed;
1 have status = Not Completed;


On the third revision:


2 have status = Passed;
2 have status = Not Completed;


... and so on...

I tried everything in views without success. I started by trying to show the data needed in table format but I can only view the latest revision, not all.

Anyone has a clue on how to accomplish this?

I'm willing to make this with code also but I would like to try views first.

Thanks!
Ok,

After some struggle, I managed to get the results I needed so, I will share how to do it. Hope it helps anyone with the same question.

At the time of this answer, this will only work with the most recent Dev version. Also, after that, you have to apply this patch. It won't work unless you make these two steps.

On your content type, check if you have the Create new revision option checked.

In views, create a new view to show Content revisions and format as Chart. Change the following inside views:

===== First Display =====

Remove the Content revision: Content relationship.

Remove the Content: Published (Yes) filter.

If you have more than one content type, the way you filter (at least I did it this way) is to add a field to the Filter criteria like this: Content (historical data): [your field] (not empty).

Set Use aggregation to yes.

Add a Content revision: Nid field to the display and set aggregation to COUNT.

On the Chart settings, select field Content revision: Updated date to provide labels and COUNT(Content revision: Nid) to provide data.

The result is a display that shows the total of nodes for each revision (x-axis date).

===== Second (and similar) displays =====

Now, you create chart add-on displays for each of the different states/values of your data field (in my case it was a status_field).

The settings for these displays are the same as the first one with one difference:

Add the [your field] field to the filter section and filter by one of the states/values. You will have to do this for each dispay, each one represents the chart for each state.

Combine the chart add-on with parent chart.

Finally, to get the chart as stacked, you have to create some code. Add the following code to your module:

function mymoudle_chart_alter(&amp;$chart, $chart_id) {
    if ($chart_id == '[my_chart_machine_name]__[first_display_machine_name]') {
    $chart['#stacking'] = TRUE;
}


Notes: remove the [ and ] from above example but keep both undersores (__).

And that's it. This is the result I got:



I have the update date of the revision to show as unix timestamp but you can have it as you like!

As suggested, here is a similar chart but using 'bar' type: