-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Regions replace does not work in regions API #1255
Comments
- Regions API is broken (c3js/c3#1255) - Only works on click on point
Confirming — just ran into this myself. Currently working around it using chart.regions.remove() followed by repopulating using chart.regions in a setTimeout. |
Adding |
Investigated this a bit further — it isn't a regressive bug, because chart.region has never actually worked. I've tried back as far as version 0.3.0 and I can't get PR forthcoming, I need this fixed literally tonight. Troubleshooting using this fiddle. |
Thanks for testing. Can't wait to use this. |
Haven't been able to figure this out yet, but have been able to best work around it by calling |
Since I want to use the regions API to respond to a user clicking on the chart, I can't use |
This is what I do. I set the new regions with a 500ms delay and a graph.flush() (using angular bower package "c3-angular": "~0.6.0")
|
I'm using @sentient's approach and it works, though it's annoying. It doesn't appear to work with a smaller timeout, which makes me wonder if somehow the chart's animation is killing the regions during rendering. |
I think this has been fixed. There was a bug that data of |
Let me close this for the moment and please reopen if something is wrong. |
You can push the g parent elements data down to the rect element by doing .select rather than .selectAll (it's a little-known d3 effect that often causes errors rather than solves them) Since there's only 1 rect per group element there's no problem with not using .selectAll
becomes |
I just re-tested with the latest version and the problem persists.
Workaround: Running |
@masayuki0812 I also have the same problem with regions API at lastest version. Can you open this issue again |
Having this problem still as well. |
Still having the same problem. |
The regions API has a method for replacing regions:
In practice, this only seems to work for initializing a region (cf.
regions.add()
), but not updating a region. E.g. in this fiddle, the first setTimeOut function will set a region, the second one does nothing.The text was updated successfully, but these errors were encountered: