I would like to see where I can help integrate the open flash chart api into this module. I am the current maintainer of that module and I have created a hacked proof of concept for the drupal 6 poll module. Looking through your code there is a somewhat different layout than what the poll drupal 6 module fits. Most importantly the .tpl files.

Here is the gist of what needs to happen to get a pie chart working, a bar chart would be approximately the same thing although there would have to be some calculations needed on the grid. Using percentage would make those calculations easier.

function theme_advpoll_pie($data, $labels) {
  $chart = new open_flash_chart_api();
  
  $chart->set_width('200');
  $chart->set_bg_colour('#EDF5FA');
  $chart->pie(50,"#FFFFFF","#000000");
  $chart->pie_values($data,$labels,array());
  $chart->pie_slice_colours(array("#379FDF","#FFA70F"));

  return $chart->render('js');
}

Let's say your voting yes or no. And yes has 10 votes and no has 5 votes this is how the variables would look.
$data = array('10', '5');
$labels = array('yes', 'no');

There are some things that I would like to add to my module, but I need to wait for it to be added in the flash library. The number one thing would be transparent backgrounds. Others would be horizontal bar charts and links on bar charts.

What ya think?

CommentFileSizeAuthor
#4 poll.tar_.gz9.6 KBredndahead
#4 poll.tar_.gz9.6 KBredndahead

Comments

anders.fajerson’s picture

Component: User interface (CSS, Images, etc.) » Code

Open Flash Chart looks awesome. The differences you see in .tpl files with advpoll 5.x and poll module 6 will probably be much less when we port advpoll to Drupal 6.

Implementation wise I see this as a matter of how we expose our data to other modules, like Open Flash Chart API, not as much as actually writing code for a specific module. I imagine most of this will happen at the theme layer for individual polls, so we want to expose enough information so developers/themers can implement support for this kind of stuff. Correct?

Personally I see this interesting in a poll context mainly for a group of polls, not so much individual ones. E.g. summarising the result from a council meeting which had 10 polls, or a graph with number of voters over time. Some kind of views support both from our side and Open Flash Chart API sounds like a possible and interesting approach to that.

redndahead’s picture

Sorry for the late response, Thanksgiving, coding yadda yadda.

I assumed it was it was because of 5.x instead of 6.x.

I'm trying to think of the logic of how one would implement OFC API if you do expose your data. Would someone have to write a module that connects OFC API and Advanced Poll? I think if it had to be themed it would be fairly prohibitive to implement for a user.

I'm not really familiar with views, I know the project and use it, but integration with it I would need some help. It would be nice if we could implement this through views. So I am open to anything.

I was thinking with linking support you could relate information together. Something like this:

Age Range
Sex
Question

Results to the question could be linked. Clicking on that link could bring up the demographic information. Looking forward to whatever I can offer.

ChrisKennedy’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have a demo of poll.module+OFC?

redndahead’s picture

StatusFileSize
new9.6 KB
new9.6 KB

Got to really figure out how to subscribe to threads. Attached, hopefully, should be the poll module with a pie chart as a graph. It should work with the latest version of the open_flash_chart_api. This is based off of Drupal 6 Beta 3. *Warning* The next version of Open Flash Chart Api are going to have major changes to the Api. This will increase flexibility and allow a hopefully less confusing Api. So watch for version 2.

redndahead’s picture

Sorry the attachment is the closest I have. I actually don't have an outside webserver to play with. Gots to gets me one of them things. I heard all the cool coders have them.

pomliane’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

This version of Advanced Poll is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.