-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.title not working on composite of line charts #554
Comments
I ran into this as well. A default title is generated with the key and value whether you provide a title or not. I also tried to put the title directly in the composite chart with the same result. |
There is also an issue with the Y axis where the domain is set to [0,10]. |
I am also facing similar issue. Is there any workaround for this? |
I had a similar problem on a barchart, the workaround I found was to replace the title text in a postrender function. You get a bit of flickering unfortunately. |
@xavier-d, could you elaborate on this and file another bug? |
@tttp : Thanks a lot.. ! It worked perfectly.. |
I have a better solution. -> By default .shareTitle is true which is causing all the troubles. |
[digging up an old issue] |
Thanks @xavier-d, these issues are old but not forgotten. If you can create a fiddle (or jasmine spec) which reproduces the problem, that will get this much closer to fixed. I may be naive but I still hope to close all bugs marked milestone 2.0 in the next month, and release 2.0. |
Ooops, I see you have specified enough to repro this. I will give it a try soon. I am very surprised if the title function is only evaluated once - the whole idea of specifying a function should be that it's evaluated whenever the data changes, but it is a common d3 error to attach attributes to create/enter when they should be on update. |
after a (really) quick look at the code
I'm wondering if the _chart.title should not be set to all the child.title (as they have been defined) if the shareTitle is set to false My 2cts comment |
I get this problem too, on series charts - titles are fine when I create the chart, but don't update when I filter. |
Actually, turns out I was on 2.0.0-alpha1 and it's fine on 2.1.0-dev. I'll make more effort to stay up to date! |
Thanks @jeenu6 ! I had the same issue and set |
I had the same problem and found a solution. Make sure to call .shareTitle(false) BEFORE calling the .compose( ...) method. |
So this bug has been open for 3 years now. Maybe we should upgrade it to a feature by codifying this behavior into the documentation of composite charts. That way, developers will know right away that they should call the just my 2 cents. |
I agree, we should document it. I wouldn't upgrade a bug to a feature, though. Looks like we'd need to document this for Action items for this issue:
|
Fixed by #1365 in 3.1.5 |
According to the example provided by the documentation https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#composesubchartarray title method should work on Composite Chart.
I've updated the example provided:
https://github.com/dc-js/dc.js/blob/master/web/examples/composite.html
.compose([
dc.lineChart(composite)
.dimension(dim)
.colors('red')
.group(grp1, "Top Line")
.dashStyle([2,2])
.title(function(d) { return 'Custom function prints this\n' + d.value; }),
dc.lineChart(composite)
.dimension(dim)
.colors('blue')
.group(grp2, "Bottom Line")
.dashStyle([5,5])
.title(function(d) { return 'Custom function prints this\n' + d.value; })
])
and it is not working
A bug ? A limitation of composite chart ? If yes the documentation should be updated
The text was updated successfully, but these errors were encountered: