I'm looking into charting libraries and I'm very impressed by the power of D3, but I'm kind of mind-boggled by its documentation. It would be a much easier decision to go with C3 instead if I knew that I could still use D3 to fill in whatever limitations C3 has.
So is it possible, with C3, to use D3 functionality to enhance charts generated with C3?
js is a JavaScript library for manipulating documents based on data. c3. js is a Javascript library which makes it easy to generate D3-based charts (less code to write). highchart is a Javascript charting framework.
D3 helps you bring data to life using HTML, SVG and CSS. D3's emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
C3. js is D3. js (D3 = Data-Driven Document) based JavaScript chart library. It is simple to use, customizable, and provides a nice API. It can be used to create visualizations using SVG, HTML, and CSS.
D3 cannot easily conceal original data. If you're using data that you don't want shared, it can be challenging to use D3. D3 doesn't generate predetermined visualizations for you.
Your question is a little too vague to be answerable -- how exactly do you want to use d3
to modify a c3
generated chart?
That said, I'll take a shot at answering anyway. d3
is all about selecting/appending DOM elements, binding data to them and then manipulating them. After c3
does it's thing, there is nothing stopping you from selecting on what it generated and modifying it further.
Here's the simplest example I can think of:
// basic c3 line chart
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
// select all it's "circles" and make them red
d3.selectAll(".c3-circle")
.style("fill","red");
If I was you, though, I'd bite the bullet and just learn d3
. If you are looking at a plotting library built on top of d3
and saying you need more, your code will be cleaner and more maintainable built from the ground up with straight d3
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With