Closed (won't fix)
Project:
Webform
Version:
7.x-4.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2008 at 13:09 UTC
Updated:
2 Nov 2014 at 20:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchLooks pretty neat. I'd be glad to include integration with Chart module directly in Webform. Any patches for this functionality would be appreciated.
Comment #2
Richard_1618 commentedI would be really keen on an integration like this, a kind of report centre for customers to view statistics on forms that suite their interests/needs,
Comment #3
daniorama commentedMaybe we should also contact with the people of webform report.
Comment #4
wpanssi commentedThere is also module called http://drupal.org/project/fusioncharts although it hasn't gained too much community. But in my opinion combining webforms with some kind of graphs would take the module into another level.
Comment #5
samchok commentedThe integration of graphs would be really nice!
I've seen this tutorial: http://drupal.org/node/233753
and it seems that the creation of a single graph is not so difficult...
Comment #6
msielskiI'm assigning this to myself as I am presently developing a module to integrate webform and the chart api. I will post more information to this issue as it evolves. In the mean time if anyone has any thoughts, suggestions, or requests I am all ears.
Comment #7
quicksketchThanks matteusx, looking forward to seeing how this goes. If (minor) changes are needed to Webform, post patches to the Webform queue and I'll assist on them. I'd like to see this as a "built-in" feature of Webform rather than a separate module, so if you have both Webform and Charts it'll pull in a webform.charts.inc file or something similar.
Comment #8
wpanssi commentedGreat! I'm looking forward for it too..
Comment #9
msielskiHi all. I've been putting some work into this in my spare time. Hopefully I'll have something that can be tested out in a week or two. I just wanted to mention the approach I'm taking to get some feedback.
As quicksketch mentioned, this would work well bundled with webform -- and I am open to doing that. Presently I am developing it as a module, and I'm not sure if there are any development considerations for eventually bundling it with webform. I think it's just an issue of distribution, not coding, but let me know.
Presently I have the module offering a Webform Chart (WC) content type. Creating a WC, you pick from a select box of webforms to indicate which webform's data you want to use. Then, similar to webform module itself, you can go to a 'components' page. The components of the webform you selected are listed here, and can be independently reordered and independently enabled or disabled for charting. At the moment each component selected will render a separate chart. For instance, if you had a webform asking for the user's age and favorite color, and selected both for charting, you will get two charts when viewing the WC node.
Editing the 'component' within the WC components form will let you adjust charting options for each. A main option I am adding, because it's specific to my needs for this, is the ability to chart cumulative data versus data over time. Charting cumulative data for a multiple choice question like "How many hours a day do you spend online?" could present a bar chart or a pie chart showing how many total responses each choice received, ever. Charting this "over time" would instead present something like a line chart (time on the x axis, number of responses on the y axis, and each response option a different line) or the same approach with grouped bar charts. I hope I am making sense. To summarize, the difference is: one option shows you a breakdown of all data collected so far, the other shows the data as it was collected over time allowing you to see trends.
Based on the webform component type, different charting options will be available, but I hope to support as many as possible (when they make sense for the data).
Of course the standard options that the Chart API exposes will be available per component: title, title size, colors, chart type, labels, keys, etc.
Finally, I'd like to provide a way to embed charts individually in other nodes or blocks. I am not sure how to handle this. I considered something like token, or a custom input format, something that would let you use text such as
[webformchart:10:3]to specify an embed of the chart for component 3 of webform chart with node id 10. I could just have the module provide blocks, however I think an embed approach like I described would be more useful - you could embed charts in nodes or blocks as you saw fit that way.Of course I appreciate any and all feedback!
Comment #10
msielskiPlease disregard my last post. I am going to change my approach. I think smaller, specific modules are much more useful, and that module users are better served by having a library of simple and interlocking modules. With that in mind, I am now planning on using the Charts module which can chart the output of a view, and writing the necessary Views integration code to get Webform data available within a view. The advantage here is that users could use the Webform-Views integration to do a variety of reporting and presentation of Webform data, irrespective of charting. With Charts, they could then chart this data. I'll keep you posted.
Comment #11
quicksketchThat sounds awesome matteusx. I admit I'd prefer to make a report through Views rather than as a node, but both approaches have advantages. I'm a little nervous about the scope of the project, it sounds like you're taking a more extensive approach than I was expecting (custom reports and such). While generating such reports would be a great Webform feature in general, I'll have to see the code that we're using to decide if it should be in Webform directly or make a separate module for it.
Comment #12
msielskiYea, everything in #9 i am putting on hold. Right now I just want to get webform data output by a view, then use Charts to chart it. So all I'm hoping to build now is Views integration for webform.
Comment #13
quicksketchIf the patch gets looking pretty big, it'd be good to split them up so that Views integration can be added in #273837: Views Integration for Webform, while charts integration can continue in this thread.
Comment #14
robbertnl commentedInteresting subject. Any progress yet?
Comment #15
artatac commentedwatching
Comment #16
cmcs commentedwatching
Comment #17
quicksketchNew features are being added to the 3.x version. I'm still very open to including this functionality if it were to be written, but there are much higher priorities for Webform as a whole.
Comment #18
sej123 commentedHI
Any progress with #9.
I am looking forward to this functionality to add a chart for a particular component of the webform.
Please let me know if any patch for it.
Thanks.
Comment #19
susi_333 commentedAny progress? :)
Comment #20
msielskiI have had to put development on this on hold, I'm sorry. I think this is an important feature and hope that someone with some more time can take a crack at this.
Comment #21
ldweeks commentedsubscribing
Comment #22
chris_bbg888 commentedsubscribing
Comment #23
wrightnow commentedsubscribe
Comment #24
dicreat commentedsubscribe
Comment #25
endiku commentedsubscribe
Comment #26
hance commentedsubscribing
Comment #27
sammyman commentedsubscribing
Comment #28
quicksketchI tried taking a look at this, but so far the Charting solutions in Drupal are very fragmented. I tried out Charts, but the API is broken and the module won't even install. It needs a lot more work before Webform provides support for it. The best solution I found was specifically for Fusion Charts (the free version). That module actually includes a Webform add-on that already works, though it's only loosely integrated with Webform.
Comment #29
Marat commentedWow ... with this function, webform 3 will be dominant all over survey and questionnaire systems!
Comment #30
luthien commentedDoes the Fusion Chart module works with webform 3? I installed the module but all I get is an empty page (webform-results/chart).
Comment #31
quicksketchNo, I don't believe it does. The module will need to be updated to work with Webform 3.
Comment #32
luthien commentedI created a new issue under the Fusionchart module: http://drupal.org/node/764762
Comment #33
sullix commentedThe fusioncharts issue seems to be resolved with the patch I submited : http://drupal.org/node/764762#comment-3035596
Comment #34
gausarts commentedSubscribing. Thanks
Comment #35
avner commentedsubscribing
Comment #36
arthurbuliva commentedI have made webform display graphical analysis on the submitted "select" type data. It is crude crude-but it is working. It involved using PHPlot and a bit of hacking of the webform module. Here we go with the steps:
1. I downloaded PHPlot from http://www.kidslovepc.com/php-tutorial/phplot-5.0rc2.tar.gz and extracted phplot into sites\all\modules\webform\components
2. Create folder sites\all\modules\webform\analysis_images. This will be used to store the plotted images
3. Open sites\all\modules\webform\components\select.inc for editing
4. Add
Between
and
5.
We now edit the function
_webform_analysis_select($component, $sids = array(), $single = FALSE)by adding this code
after
but before
Open the results page of your webform submitted data and click analysis. You should see the graphs unser the select field.
I would welcome improvements and or a total incorporation of this method into webform.
Comment #37
arthurbuliva commentedHere is the module. Please review.
Comment #38
arthurbuliva commentedHere is the module. Please review.
Comment #39
quicksketchHi arthur, in order for me to review these changes and consider them for including with Webform, I need the changes in a patch format. See http://drupal.org/patch/create for how to create patches. I'm very interested in including charting functionality in Webform, but I'm not sure this is the way that we should take this.
Comment #40
arthurbuliva commentedPlease find attached the patch file. I have taken the functionality of phplot and incorporated that into webform.module
Comment #41
arthurbuliva commentedPlease find attached the patch file. I have taken the functionality of phplot and incorporated that into webform.module
Comment #42
hlan commentedAs Fusionchart is not working, I believe this PHPlot is the best option for us. Let me test the latest patch and I'll update you guys.
Comment #43
arthurbuliva commentedA small fix that takes care of the graph not displaying in case there are no results submitted
Comment #44
shawn dearmond commentedI'm wondering if it's the best plan to take PHPlot and dump it wholesale into webform. Maybe it should be added separately as a library. Another thing to consider is that PHPlot is LGPL. Does that meet the requirements for posting the code on Drupal.org?
Comment #45
arthurbuliva commentedThe PHPlot I have comes with GNU GPL license. Check the link I provided earlier on
Comment #46
quicksketchI definitely won't be adding PHPlot into Webform under any circumstances. This patch is pretty much dead on arrival. I'm very interested in making Webform have the capability to work with graphing solutions, but I don't anticipate building any one library directly into Webform.
Comment #47
codekarate commentedThis would also be very useful for a project I am working on. Has anyone made any progress on a good graphing/chart solution for webform?
Comment #48
enkara commentedSubscribing
Comment #49
goldhat commentedThis is an interesting idea and I hope it will come to life! I want to suggest that Google Charts API be considered as the charting solution. http://code.google.com/apis/chart/
I used Google Charts for a project in D6 which integrated with Views and it was easy to work with. For that project we made a Views Style that would output a Google Line Chart, so when setting up the View instead of unformatted/table/grid you would select "google chart" and then some options would come up with various settings that were fed in to the Google Charts API. In that case we needed the ability to pass settings to Google Charts, but in this case those settings (such as chart width/height, label types, legend position) could probably be coded into place, or provided in a theming function? Or maybe in a Webform Admin Settings page named "Chart Options"?
I'm thinking if we can get the data into Views, Google Charts is so simple that it can be output from the data at the theming level, such as in a preprocess function. Essentially a Google Chart is an image, and that image is created by sending data to the API. So if the Google Chart API is used in a preprocess function, then this can return the finished chart to the theme layer.
Comment #50
goldhat commentedFor quick reference this is an example Google Line Chart, note how the data is passed in the URL and displayed, for example "chs" is the variable used to determine the chart width/height.
http://chart.apis.google.com/chart?chxr=0,0,46&chxt=y&chs=300x225&cht=lc...
Here is a link to Google Charts beta version chart creator that is a good way to try out the different chart types and see how they are generated with the API: http://imagecharteditor.appspot.com/
Comment #51
hey_germanoI've been trying to get this to work on the theme layer by overriding the Analysis page (function theme_webform_results_analysis) and bringing in the Chart module for easily using the Google Chart API. Sort of like what goldhat was saying, but simpler, and it doesn't totally work yet.
I'm having a tough time getting the webform results array into the right format to hand off to the chart_render function.
But I think it's possible, and this might be a good start? Any guidance about how to make this work right would be much appreciated!
EDIT: I figured out how to use var_dump and found that the better approach might be to get up in the $row_data and $questions arrays separately (instead of using the $rows array that I had in the first version of this question, which was a mashup of both arrays).
Here's what I've got in my template.php file:
$row_data is structured like this (this repeats for each question, var_dump output here):
So, to make this work, I've got to get this $row_data array looking like the $test_chart array, for each question. Any ideas?
Comment #52
bbcsubscribing
Comment #53
zeezhao commented+1
Comment #54
ccoppen commentedHere's a first pass at this.
It still needs some work, such as a config page, but it works.
It started with the analysis page and then morphed into what it is.
http://drupal.org/sandbox/ccoppen/1361504
Let me know feedback and if you can access it. I'm new to this module creating thing.
Comment #55
ccoppen commentedComment #56
hotspoons commentedHere's a second pass, based on ccoppen's original module, but with support for additional charting libraries (namely google visualization), configuration, and an API. http://drupal.org/sandbox/hotspoons/1450784
Comment #57
quicksketchI've adopted the http://drupal.org/project/charts module to bring it up to speed for Drupal 7. Although I haven't tried it, you should be able to combine Webform's Views support with Charts module to produce charts for specific Webforms. However for adequate charting support throughout the module, this will probably become a separate project. The first step is probably #1459372: Patch to provide usefully formatted data structures for 3rd party webform analysis (e.g. charts).
Comment #58
KristineC commentedConfirmed- Webform's Views with Charts does produce charts for Webforms with a minor error due to the select options. It's looking really nice! I got it to work with Google Charts but not HighCharts.
Notice: Undefined index: options_source in _webform_select_options() (line 854 of .../modules/webform/components/select.inc).
Comment #59
quicksketchWe probably have an issue where Highcharts needs to receive integer/float input, but the Views integration is returning strings. I think Charts module is supposed to be casting values to integers/floats for you. Could you open a new request over in the Charts queue for this problem?
Comment #60
KristineC commentedSure- https://drupal.org/node/2069079
Comment #61
dom. commentedHi !
I don't know what is the current status of charting with QuickSketch module. However you can use Webform Chart module in conjunction to Charts module for a nice chart data display result page.
@QuickSketch : it may be a good idea to combine efforts on this if you need help on charting.
Miro.
Comment #62
danchadwick commentedSolution is to use the chars modules and views integration.