Closed (fixed)
Project:
Visualization API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2013 at 17:09 UTC
Updated:
8 Apr 2015 at 22:04 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
tim.foxell commentedHaving slept on this and done a bit of reading on style plugins this morning I have managed to resolve this.
I've included a field for the chart Title, with a default of "Chart 1" and kept the fall back of the $view->human_name set in visualization.theme.inc.
I noticed that the yAxis title was not being stored and have resolved this also. However it does not get displayed on the chart when rendered. If you point me in the direction of where that is processed I'm more than happy to take a look at that as well.
I'll supply a patch as soon I work that one out...
Comment #2
tim.foxell commented.
Comment #3
tim.foxell commentedSee attached patch.
Comment #4
alexweber commentedI was just about to open an issue for this!
Great work, I can confirm it works as advertised!
Comment #5
tim.foxell commented@alexweber,
Yeah it works fine. Chart defaults to "Chart 1" and you have a text field in the visualization settings where you can set the desired title for the chart. I've attached a screenshot of this and also an example of three charts displayed on one page with three different titles. The three charts are all in separate views Attachment displays.
Tim.
Comment #6
alexweber commented@tim.foxell, as a nice added bonus it'd be nice to be able to omit the title altogether. (seems ok with GVA options)
In my particular use case the charts are placed in blocks in a dashboard layout and the block title is doing the job for me ;)
Since this patch is RTBC it might be easier to open this as a follow-up issue though...
Comment #7
tim.foxell commented@alexweber,
There is possibly a more elegant way of doing it, but this gives you the functionality you are looking for.
Tim.
Comment #8
tim.foxell commentedIncluded fix for the yAxis title which is now stored and displayed on line and column charts.
Comment #9
tim.foxell commented@alexweber, do you want to review the latest patch which resolves all comments in this issue? Cheers, Tim.
Comment #9.0
tim.foxell commentedupdate description
Comment #10
alexweber commented@tim.foxell, awesome dude, thanks!
Sure, I'll be test this and post back by the end of the day hopefully! :)
Comment #11
tim.foxell commentedComment #12
alexweber commentedAll fixes work as expected! Thanks!
Comment #13
rooby commentedI think this is still broken.
It should never be using $view->human_name because it is against anything any user has seen in views before.
Every views integration module I've ever seen uses the view display title as the title.
If the display title is empty then there is no title.
Having it use the human_name, which prints even when the display title is not set is counter intuitive.
Then having an extra setting for not showing any title is convoluted.
I will do another pach for comparison.
Comment #14
rooby commentedHere is a patch that uses the view title for comparison.
Its benefit is that it is a simpler solution but I'm having second thoughts now.
The downside to this patch is that you can't have a different view title to the chart title.
So I'm guessing maybe the previous solution is better because it gives more flexibility.
Comment #15
rooby commentedI've realised the error of my ways, so here's another one.
This one is the patch from 8 with the following changes:
* Exclude title is now show title and it works in reverse as you might expect. This is the same concept as views fields use to show a label.
* The title field is dependent on the show title field (another reason for the previous change), so it hides when it is not relevant.
* Uses $view->get_title() instead of $view->human_name.
* Changes the default title to an empty string.
* Removed an unneeded comma.
This is now my preferred solution.
Opinions?
Comment #16
alexweber commentedAwesome!
I like but gonna refrain from RTBC until others get to test as well
Comment #17
rooby commentedHere is a version of the patch in #15 that applys over the top of the patch at #1809850-7: Provide more ability to override chart options, for anyone who is using both.
Comment #17.0
rooby commentedUpdated issue summary.
Comment #18
Niremizov commentedProbably the most simple solution is the best? Like in #3?
If user need chart title he would enter it, otherwise there would be no chart title...?
Comment #20
Niremizov commentedDone here.