Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to override chart options, i'm trying this with google charts.
Seems like hooks are not implemented yet. hooks in charts.api.php file are not working now.
Is there any other way to override options?
Comments
Comment #2
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedThe API probably needs to be replaced. I would recommend relying more on the plugin system and do something like I did in the following link. If this doesn't accommodate your use case, I would love to hear more about it. You may also want to look at the Charts Blocks sub-module included in the latest -dev.
https://github.com/andileco/chart_block_example
Let me know how things go--I'm really interested in making this an awesome module!
Comment #3
Anas_maw CreditAttribution: Anas_maw as a volunteer commentedI had a look on both modules, both are creating a new chart in block.
To be more clear i have a view which render a google chart. i want to add more options which are not provided in the module.
We have two options:
1. Implements all options in setting form. (Which i thing it's hard to cover all options.)
2. Alter options in code before generating the chart and add our custom options.
Do you have any idea how we can reach this?
Comment #4
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedOne idea might be to implement a custom Views style plugin with a raw_options field. I'll think more about it. If you have a different idea, please let me know!
Comment #5
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedHeads up that pretty soon I'll be committing some code that allows for this. I'll need testers, if you're still interested.
Comment #8
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedMight need a good bit of work still, but this is something to try now. I need to step away a little, as I have been looking at it too closely.
Comment #9
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedI've created a "starterkit" module that can be placed in modules/custom and be modified by the user.
Comment #11
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedComment #13
DrIPA CreditAttribution: DrIPA at DICTU commented@andileco is there any news about the #raw_options in views? I've installed the latest 4.x dev version but it seems there is no support for raw_options in the views plugin style.