It would be nice if each chart were given a unique ID, and then that chart's renderable would be alterable.

CommentFileSizeAuthor
#1 charts_chart_alter-2050921.patch6.2 KBquicksketch

Comments

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new6.2 KB

In order to do this, we need each chart to have a machine name, so I created the #chart_id property for this purpose. Additionally, I found that a single hook was not enough, since you may want to alter the chart *before* the library abstraction (for using existing options across all libraries), but also *after* the abstraction in the event you want to modify a raw chart definition before the charting library gets ahold of it. This patch adds these two hooks, plus the general more-specific versions for per-chart functions.

quicksketch’s picture

Status: Needs review » Fixed

Gave it another review and looks good. Committed and pushed.

bennos’s picture

Some question in this patch.
1. Can I overwrite the chart style in a custom module?
Example:
myview_block
charttype: polar

2. Can I also combine two views to get an combo chart like this
http://www.highcharts.com/demo/combo ????

I know, you would say, better do this in directly in code, but views has some good caching plugins, that I can not use without much overhead in a driectly coded chart.

quicksketch’s picture

1. Can I overwrite the chart style in a custom module?

Yes, though if you need to adjust the data format it may require more work than just changing the chart type.

2. Can I also combine two views to get an combo chart like this

Yes you could do that, but you don't need to do this any more because we now have this feature built-in as part of #2052429: Make multiple series charts easier to create through Views. Just make a chart, then add a second display that is a "Chart add-on" that uses the first chart as a parent. Then the two charts will lay over the top of one another when the parent chart is rendered.

Status: Fixed » Closed (fixed)

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

Pierre.Vriens’s picture

Title: Make charts alterable » Make chart's renderable alterable via charts hooks
Issue summary: View changes
Parent issue: » #2231961: Enhance Charts documentation

Definitely something that needs more docu ...