I can replicate the charts I see in the wiki page and d.o. but when it comes to use cck / views to extract the data to populate the chart I don't know where to go... having to manually enter the numbers for the chart in the php snippet looks pretty unsafe to let end users do, so I assume the idea is for people to fill cck boxes and then pull that info to generate the chart (or tell views were tog et the info from and do the same). But I am at a loss there...

If anyone has a link with some how-to for cck / views integration it would be great, or the code snippet to change the "3" in $chart['#data']['fruits'] = 3;
to " field_cckname[value]" or whatever, would do too.

Thanks,

Comments

roam2345’s picture

I would also appreciate a document page on creating a chart from a view... I have been trying for weeks to get this working.

Would be greatly appreciated.

BenjamiB’s picture

subscribe

leszek.hanusz’s picture

subscribe

ScottW’s picture

I can get you started under Drupal 6 - I've not done a lot yet with 7.

1) Create your content type and add a node with that type
2) Add View (node type)
3) Set the filters to be something like Node: Published and node type = your type. In my case I did a test with an iFrame content type that had a url field.
4) Add your fields to the view - again, for my test I just added the content field that contained the url and took the various defaults
5) Change the view style from unformatted to Google Chart - select the type of chart you want (I did a QR Code - a chart not in the current 6.x module, but one I added to the module). Specify your width and height and select a field you want to use as a legend. Then select the fields you want to perform an operation on - in my case it was the URL field. Specify the operation you want to perform (I selected none since I just wanted the URL to be sent as it was).
6) Once I set the style information the preview display brought up the QR code. No PHP coding was harmed in the creation of the view

For me, the next step would be the create a Block display for the view, which I can then use on my pages - or a page display. You'll need to modify the process to do things for other types of charts - but this should get you started.

--Scott

13rac1’s picture

Title: Documentation » Create detailed Views integration/use documentation
Category: support » task
Priority: Normal » Minor

Someone want to do this? A simple How To for a pie chart would probably be best.

johnv’s picture

Here's a nice post of LinClark showing how to do it: http://lin-clark.com/blog/turning-cias-data-pretty-pictures-your-site-us... . Chart module comes in afte 10 minutes.

BenK’s picture

Subscribing

BenK’s picture

Priority: Minor » Normal

In the video referenced in comment #6, she actually makes a small bug fix (changing a pipe to a comma) that allows 3D pie charts to work in Views. It occurs at 13:30 in the video (total video length is 15:10).

Has anyone submitted this fix as an actual patch?

I tested this change and it works just like it does in the video... it is necessary to make pie charts work (and possibly some other charts, too).

--Ben

johnv’s picture

I didn't apply this fix.
In my case, the pies did show up as expected. In the video, there were no pies at all.
However, I have this issue: #1256050: Charts showing nid as value instead of value .

13rac1’s picture

@Benk an issue for the pipe to comma change is #1117002: How to make a 3D Pie chart work with views.

I'd prefer text/images for the documentation. Ideally suitable for advanced_help. Try to work on it, once I clean up the rest of this issue queue.

Pierre.Vriens’s picture

Issue summary: View changes
Parent issue: » #2369883: Create chart documentation
Pierre.Vriens’s picture

Title: Create detailed Views integration/use documentation » HowTo about Views integration
Pierre.Vriens’s picture

Status: Active » Needs work