-
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
Make it possible to hide data from a chart without unloading #731
Comments
To clarify, I want to hide the data altogether from the chart elements, including legends. So I know I can hide the chart element, but I don't want to give users the option to turn it on. I guess if there's a way to also hide select options in legends, then that would satisfy this use case. |
Sorry for poor documentation. I think this should work:
Could you try this? |
No worries, thanks for putting me on the right track. I may have found a bug or it could be user error 😄 I have this right after I generate my chart
And I get this: With this error and stacktrace in the debugger:
I'm using the latest c3 0.4.3 release |
Thank you for the detail. I think you might need to call |
Ah, that makes sense. Is there a way to pass in a callback to c3.generate? Otherwise I can set a timeout. |
I added
|
That worked 👍 Thanks! This is really a great library. I hope I find some time to contribute more than ask for help, but I really appreciate the help. |
OK 👍 v0.4.4 has been released, so please let me close. |
when i try click a chart (ex. bar) is there way to get value from data.hide? @masayuki0812 |
Thanks that worked for me too, |
@clement911 did you ever figure this out? |
I'm afraid not. |
came up with a creative workaround :) I hide the line using css and use c3 to hide the legend and then its available just in the tooltip |
When custom colors specified bars do not have correct color. var chart = c3.generate( {
"data": {
"x": "x",
"colors": {
"data1": "red",
"data2": "green",
"data3": "blue",
"data4": "orange",
"data5": "black",
"data6": "violet",
"data7": "gray",
"data8": "magenta",
"data9": "yellow",
"data10": "pink"
},
"type": "bar",
"columns": [
[ "x", "46","47","48","49","50","51","52","53","1","2" ],
[ "data1", 9,9,9,9,9,9,9,9,9,9 ],
[ "data2", 9,9,9,9,9,9,9,9,9,9 ],
[ "data3", 9,9,9,9,9,9,9,9,9,9 ],
[ "data4", 9,9,9,9,9,9,9,9,9,9 ],
[ "data5", 9,9,9,9,9,9,9,9,9,9 ],
[ "data6", 9,9,9,9,9,9,9,9,9,9 ],
[ "data7", 9,9,9,9,9,9,9,9,9,9 ],
[ "data8", 9,9,9,9,9,9,9,9,9,9 ],
[ "data9", 9,9,9,9,9,9,9,9,9,9 ],
[ "data10", 9,9,9,9,9,9,9,9,9,9 ]
],
"hide": ["data7", "data8", "data9", "data10"],
"groups": [
[
"data1",
"data2",
"data3",
"data4",
"data5",
"data6",
"data7",
"data8",
"data9",
"data10"
]
]
},
"axis": {
"x": {
"type": "category",
"label": {
"text": "",
"position": "outer-right"
},
"tick": {
"culling": true
}
}
}
}); P.S. Reopen? |
Is it possible to simply stop data from loading in the chart without actually unloading the data itself from the data object. I'm toying with a use case where related data could be included in CSV, but only displayed in the tooltip (for example, margins of error).
If it were possible to just stop the visual for a particular data id from loading without removing the data altogether (through unload) then I could access the data in the tooltip contents without referencing another source.
Does that make sense. So the feature I'm looking for is something like
instead of an
Is this currently possible, and I'm just missing it? I understand this may be an edge use case, but being able to pass in data and not load it into a chart would allow easier access to data for cases where someone wants to use and manipulate that data in non-chart elements.
The text was updated successfully, but these errors were encountered: