0

I have a custom database table with a datetime column that I have made accessible to Views. I want to create a line charts of number of rows per day but I can't get the View right.

With aggregation on I have a COUNT on my ID field and I'm trying to group on my date field by day (it currently has year -month - day - hour - minute - second). I have set the date format to d/m/Y and aggregation to group results together but they are still separate.

enter image description here

Obviously this makes for a pretty bad line chart

enter image description here

What I really want is

18/01/2017    23
19/01/2017    25
20/01/2017    19

I tried the Views Date Format SQL Field module (dev version too) but it doesn't seem to work as I don't get an option to format my date as SQL.

Is this possible in Views?

2
  • About the "Views Date Format SQL Field"-module you mentioned, do you mean drupal.org/project/views_date_format_sql ? I.e. without the "field"-part of it? Also, are you using any (contributed) charting module for such charts? If so which one? FYI: tagging a question with "charts" doesn't automatically mean "I'm using the Charts module", which is why I wonder ... 1 more question: how about an alternative to using the Views module to create such a similar chart (which uses a free of charge, and open source, charting engine ...)? Commented Jan 27, 2017 at 17:16
  • Yes, that's the module I meant. I've tried both the Charts module and the Visualization module, same problem for both. I've not tried it without Views yet, I though this kind of grouping would be something Views could do.
    – nexus_6
    Commented Jan 30, 2017 at 10:05

1 Answer 1

0

I believe there is a way to do this by rewriting the field described in this issue: https://www.drupal.org/project/charts/issues/2915097. There is also grouping enabled now if you want to stack your charts. Please download the latest -dev version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.