About installation and usage of module with Open Flash Charts

etcetera9 - September 15, 2009 - 19:03
Project:Views Charts
Version:6.x-1.0-alpha1
Component:Documentation
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

Hello,

After having hard times installing and using the modules and finally making it work, I wrote a tutorial about the installation and usage. I hope it will help somebody in the future.

I don't know where else to put it so I wrote it on my personal blog: http://sinan.bilimternet.com/blog/charts-and-graphs-drupal

If you (the module maintainer) like it, feel free to use it on anywhere you like.

Cheers...

Sinan

#1

irakli - September 15, 2009 - 19:21

Thank you. Much appreciated.

#2

danieldd - October 2, 2009 - 16:17

Thanks- this documentation was extremely helpful, and has enabled me to get Views Charts working easily.

To anyone who is wondering I can confirm that, unlike the Charts module (it seems), this module does enable charting of multiple fields of data from a view.

However, I still had problems with the charts themselves - eg legends/ labels not displayed properly, scales not right, charts took a while to render, looked messy etc. Overall this means that unfortunately I cannot yet use this module. These issues may be due to limitations of open flash charts. It's a shame the module does not yet support Google charts.

I just wanted to let the maintainers know how much this module is appreciated and hope some of these remaining issues will get ironed out (sadly I don't have the skills to help fix myself).

#3

irakli - October 11, 2009 - 02:22

Daniel,

thank you for the feedback.

Have you tried using other charting implementations? Views_charts works with two other charting solutions aside from openflashcharts.

#4

danieldd - October 13, 2009 - 12:49

Thanks for the advice.

I have installed amcharts and the charts look (in my view) significantly better than open flash charts, and they feel tantalisingly close to being usable on a production site.

I am able to plot quality, quick loading charts on multiple series and fields of CCK data.

However, there are still a few presentational issues, some probably easily fixed, that I need to resolve to be able to use these (PS - sorry if posting this in the wrong issue queue).
Eg:
Charts background colour problem - workaround here: http://drupal.org/node/583712
Lack of option for vertical columns chart - fixed by adding on line 84 of views_plugin_style_chart.inc: 'column' =>t('Column'),
Chart does not correctly show chosen minimum value for Y axis - still trying to fix.
Reducing (or changing) margin size around plot area - still trying to fix.
Ideally - Ability to plot data in columns rather than rows.
Ideally - Ability to truncate axis titles (as per settings in Views module).

If anyone can solve any of the above issues, please let me know! Thanks for a great module and hope you will find the time to extend & improve it.

#5

etcetera9 - October 13, 2009 - 14:50

For Open Flash charts I have proposed a way to fix "minimum value of Y" problem in the tutorial as:

if you add this line to the charts_openflash.inc file which can be found in modules/charts_graphs/apis/charts_openflash:

$min_value = $canvas->y_min;

Just after these lines:

$obj->values = $val;
$max_value_arr = max($val);
$max_value = ($max_value < $max_value_arr) ? $max_value_arr : $max_value;
$min_value_arr = min($val);
$min_value = ($min_value > $min_value_arr) ? $min_value_arr : $min_value;

It works! :)

Maybe you can do something similar for AMcharts?

#6

danieldd - October 14, 2009 - 13:04

Unfortunately the code structure for the amCharts API is different.
I've worked out how to pass a value for Y minimum value to the charts in the amcharts.class.inc file.

However, I cannot seem to retreive the Y minimum value entered in the Views form.

$min_value = $canvas->y_min;

Does not retreive the Y minimum valued entered.

The solution to this issue must be extremely simple although so far beyond my beginner programming skills. If you have any other suggestions please let me know!

#7

danieldd - October 15, 2009 - 09:29

OK, I've figured solutions to some of the amCharts issues I experienced:

Chart does not correctly show chosen minimum value for Y axis - addressed by adding the following bits of code to amcharts.class.inc

Add this to line 115 of amcharts.class.inc

$min_value = $this->y_min;

Then add this somewhere within the $settings variable (eg around line 135)

<values>
    <value>
      <min>" . $min_value . "</min>
    </value>
  </values>

Reducing (or changing) margin size around plot area - added this within the settings variable (ie from line 135 of amcharts.class.inc)

<margins>
      <left>10</left>
      <right>10</right>
      <top>10</top>
      <bottom>10</bottom>
    </margins>

The numbers here represent the desired margin size in pixels.

In general the charts can be customised exactly how you want them (size, colours, labels, scales, animation etc) within this $settings variable (although still have not solved my last 2 issues in #4 above). You need to follow amCharts very simple code syntax which you can see at: http://extra.amcharts.com/editor/

I can confirm the charts look great and are, I think, now usable on production sites.

As a suggestion to the maintainer, can I recommend that this module (and Charts and Graphs) prioritises amCharts (or Google charts) which seem to produce great results - rather than trying to support numerous APIs with more limited functionality in each. And enable more chart settings to be configured through the views form. It doesn't look complex at all to give more control over the charts and this would add greatly to the module.

#8

etcetera9 - October 15, 2009 - 10:28

One problem of amCharts is that it is not free and open-source. Of course they provide a free version but it is annoying to see the link on every graph.

#9

etcetera9 - October 15, 2009 - 10:29
Title:About installation and usage of module» About installation and usage of module with Open Flash Charts

I think it is better to continue the subject on a related issue. This one as the title suggests is not related with amCharts...

#10

najibx - October 17, 2009 - 20:06

hi ..adding "$min_value = $this->y_min;" as suggested didn't solve my issue.

This is not related to http://drupal.org/project/open_flash_chart_api, but that module requires you to Copy the js folder and open-flash-chart.swf to the module folder. BTW, open-flash-chart.swf is already in here, but different size (different version?). Either way, tried this also, and not working.

Actually, I only got the bluff chart working now.

#11

danieldd - October 19, 2009 - 15:43

note my instructions in #7 relate to amCharts not Open flash charts (sorry for confusion). And also, if you are trying to get amCharts to work adding that line alone does not solve it -follow the complete instructions.

For open flash charts see solution in #5 above.

Both these formats work if you follow instructions above and elsewhere in the issue queue.

 
 

Drupal is a registered trademark of Dries Buytaert.