0

I have a page that clients can upload their csv files, save it to the server, then ajax will pass the location of the csv.

Question is I can't find a way for zingchart to reload with a new csv url, tried many ways in the document, below is my uncomplete code, don't know if there is any method in zingchart.exec can achieve this. Thanks for any suggestions or help

   $.ajax({
               type: 'POST',
                url: '/upload_csv',
                data: form_data,
                contentType: false,
                cache: false,
                processData: false,
                
                success: function(data) {
                    zingchart.exec('chartjs-line', 'modifyplot', {
                       data:{
                          csv: {
                            url: data.csv_url,
                             verticalLabels: true,
                           }
                       };
                     }
                 });
            
      });
Jon4thanPP
  • 27
  • 7

1 Answers1

0

You should be able to do this with the modify function, the same way you have it set up currently. modifyplot targets the plot object within your graph object; csv should be a member of your graph object.

If you have any other issues, the fastest way to get support is emailing support@zingsoft.com or starting a chat with us on our site!

  • The modify function takes a lot of time to load, and I don't know why the x-axis did not update, anyways, I use the load function instead, save and read the local jsons to reload the chart, thanks – Jon4thanPP Apr 06 '21 at 03:42