Home forums Using CanvasJS Can't calculate because of the thousand seperators

This topic contains 2 replies, has 2 voices, and was last updated by  Manoj Mohan 2 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25724

    Hi. I am using canvasjs to calculate the csv data and display them in a line chart. However, the line chart can’t display the calculation because of the thousand seperators in my csv file. If I remove those seperator in csv file column, the line chart works normal. So, what can I do? Thankyou.

    #25725

    thousand seperators are in points[2]
    I have tried to calculate points[1] and the chart works but not in points[3]

    function getDataPointsFromCSV(csv) {
      var dataPoints, csvLines, points;
      dataPoints = csvLines = points = [];
      
      csvLines = csv.split(/[\r?\n|\r|\n]+/);
      for (var i = 0; i < csvLines.length; i++)
        if (csvLines[i].length > 0) {
          points = csvLines[i].split(",");
          price = Math.log(points[3])
    • This reply was modified 2 months, 3 weeks ago by  pater.
    #25738

    @pater,

    Can you kindly share sample project along with sample CSV over Google-Drive or Onedrive so that we can look into your code, understand the scenario better and help you out?


    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.