Home Forums Chart Support AJAX return data

AJAX return data

Viewing 3 posts - 1 through 3 (of 3 total)
  • #42140

    This chart is fantastic and the support here is top quality.

    Can someone provide an example how to return AJAX data from the chart page back to MVC Controller?

    I would like to have 3 check boxes on the chart page that can go to the MVC controller via AJAX.

    This is to filter the data and re-render the chart.

    I was attempting to put the return request inside of data but I dont have the syntax quite right.

    here is what I have tried;

    				data: [{
    					type: "rangeBar",
    					yValueType: "dateTime",
                        indexLabelFontColor: "white",
    					indexLabelPlacement: "inside",
    					indexLabelFontSize: 12,
    					dataPoints : dataPoints
                    }] function(d) {
                        return $.extend({}, d, {
                            "checkbox1": $('#checkbox1').val(),
                            "checkbox2": $('#checkbox2').val(),
                            "checkbox3": $('#checkbox3').val(),

    I solved this by doing an AJAX post outside of the canvasjs workflow. But very curious if the AJAX post can be done within the canvasjs data: tag.



    Glad you were able to figure it out. As of now, AJAX call has to be performed separately, and chart options can be updated based on the data fetched from it.

    Thangaraj Raman
    Team CanvasJS

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.