Hi,

i tried to render Highcharts with views but i had no success. I fixed the theme function and removed the template file. Please review.

Comments

webflo’s picture

Ups. The view class was in the wrong info file.

Scryver’s picture

Status: Needs review » Fixed

WOW! You really fixed it! What was the exact problem?

webflo’s picture

Status: Fixed » Reviewed & tested by the community

The theme function was buggy. This patch is not in committed yet. Back to RTBC.

Scryver’s picture

Oh yeah, of course it needs more review. But really it should be committed soon :-)
If I have it correct it was mostly implementing the hook_theme(), right? Thanks again.

stovak’s picture

We're currently re-writing the core configuration of this module to make it more responsive and object-oriented. We'll have a solution for the tooltip formatter soon. One that makes sense and is consistant with drupal standards.

We're looking at a config stack that isn't based on loading a JSON file. Hope to have it committed soon.

-tom

scottrigby’s picture

@stovak I think your comment in #5 was meant for #1466016: Tooltip formatter (I'm pretty sure the new upcoming php-library/oo approach won't affect this container rendering issue).

@webflo Personally I think this patch looks good. We can't declare 'theme' => 'highcharts_chart' directly in hook_views_plugins() because theme_highcharts_chart() expects only the $attributes array . This looks like a good way to handle that.

The main reason I added that doxy comment @todo instead of just changing this when folding in the 1.x Views integration stuff into the 2.x branch, was the question about themability. But for the hichart container remdering, IMO we don't loose much there using this theme wrapper function over the standard Views tpl file (seeing how we now have two theme functions that can be overridden!).

stovak’s picture

Sorry, guys. Yes, the response is to the other issue. Sorry.

mpisano’s picture

StatusFileSize
new61.09 KB

Its works!!!
After apply the patch, I had this error:
Notice: Undefined property: stdClass::$tooltip in highcharts_render() (line 87 de /sites/all/modules/highcharts/highcharts.module).
Notice: Trying to get property of non-object in highcharts_render() (line 87 de /sites/all/modules/highcharts/highcharts.module).

I've solved commenting the 87 line of highcharts.module:

//$formatter = $options->tooltip->formatter;
//if ($formatter) {
// drupal_add_js("Drupal.settings.highcharts.{$chart_id}.tooltip.formatter = $formatter", array('type' => 'inline'));
//}

Thanks for this fantastic module!!! after all the day trying with all versions of Charts, Google chart API and others, these is de only 7. module that works fine with views.

dshields’s picture

Where should I apply this patch?
When I try to apply in the root of the highcharts directory, I get the following:

patch < highcharts-views-integration-fix
can't find file to patch at input line 11
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|commit 024382082c1291a961b700d7247ad5940ef27f0d
|Author: Florian Weber <f.weber@digi-info.de>
|Date:   Fri May 4 22:26:24 2012 +0200
|
|    Issue #1561694 by webflo: Fixed current views integration.
|
|diff --git a/views/highcharts_views.info b/views/highcharts_views.info
|index 5e4d1ab..3ef1029 100644
|--- a/views/highcharts_views.info
|+++ b/views/highcharts_views.info
--------------------------
File to patch:   	

Any help would be appreciated!

dshields’s picture

Nevermind, I figured it out - had to manually edit the .info file for now..

scottrigby’s picture

Title: Fix current views integration » Highcharts views theme functions and templates
Component: Code » Views integration
Category: bug » task
Status: Reviewed & tested by the community » Needs work

Changing name for clarity. This will be part of refactoring Highcharts views integration in the 2.x branches.

scottrigby’s picture

Status: Needs work » Fixed

A slightly more extreme version committed as part of 84f4128

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.