Since the version 1.0 of CanvasJS our primary goal has been to make it as simple as possible for you to create and add charts. Given that jQuery is being used widely over the web, we thought of building a simple jQuery plugin that would allow you to integrate CanvasJS Charts the jQuery way! So if you find $(“selector”).someAction() way of adding chart convenient, you can do so with CanvasJS Charting Plugin for jQuery.
In case you have any suggestions/feedback please post it in our forum.
Here is how you can create a simple chart using the jQuery Plugin.
Here are couple of things that you need to remember while working with the jQuery chart plugin.
$("#chartContainer").CanvasJSChart().options.data[0].type = "column"
. Refer Updating Chart Options/Data for more information.
Below is a simple example that shows how you can update chart once it has been created.
Have a look into our reference section for complete set of options that are available. In order to make it simpler we have also created examples of various chart types using jQuery Plugin.
8 Comments
How can we do something like “say for a column/bar chart, user clicks on a column/bar and an event is triggered with its attributes’ values”.
e.g., A column chart with two columns, namely A and B with values 10 and 20 respectively are shown, when we hover over these columns we can view the values. Now, say I click on A, I want that object/selector so that I can get the value 10 and use the same to trigger a function.
subham,
Please refer to this page.
I love this! great tool!
Instead of the “window.onload = “, how do I set this as a function that I can call after all my calculations to fill the data arrays?
Please refer to this example.
how to load data from database data?.. sample coding for using web method using asp.net/C#?
very interesting
thanks
please help me collection data with ajax.
it like this:
$.ajax({
type: ‘GET’,
url: ‘http://example/functions.php’,
data: { get_param: ‘value’ },
dataType: ‘json’,
success: function (data) {
$.each(data, function(index, element) {
$(‘body’).append($(”, {
text: element.name
}));
});
}
});