1

I am trying to use the Google Chart Tools module to display graphs with data regarding content types inside a view (Views module). For example, lets say I have a content type called Car that has a field called Color. I would like the graph to display, say, the number of Cars that are blue, red and green.

Is there a way to do this using only the the Google Charts, Views, and Core drupal modules or do I have to download a seperate module? Is there another Charts module that would do what I am asking for more easily than Google Charts?

1

Step 1: Getting started

To create charts in Drupal, you can (also) use the Charts module. It comes with a sample view which will give you a chart for each of your content types.

Just clone and refine that view, and check how close you are to make it fit your needs. Refer to Create charts using Views (and its subpages) for more details.

For a sample of such chart (derived from the delivered sample view), have a look at this demo sample.

Step 2: Create the tabular format of the view

A common mistake when creating charts, is that the data to be charted is (not yet) correct. So you really need to first work on getting the tabular format of the view created correctly. That's also what's recommended in the Bonus tip within Steps to create charts using the views UI, i.e.:

You may find it easier to start with a "Table" display and convert it to a chart display after setting up the data. It can be easier to visualize what the result of the chart will be if it's been laid out in a table first. ...

Step 3: Add the chart to your view

Do not try to start this step if you didn't first complete the prior step.

Just use the views display format "Charts", and select the various options that fit your needs. Refer to Steps to create charts using the views UI for detailed instructions about this.

Disclosure: I'm a (co-)maintainer of the Charts module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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