Home>

Writing a waveform display program (HTML) using AnyChart.
I was researching and there was a program that reads a CSV file on the net and turns it into a bar graph, but I want to read a CSV file saved on my computer and draw it like a sine wave . I don't know a program that reads a CSV file with a waveform like a sine wave.

Error message
Error message
Applicable source code

The source of HTML.




Real Chart







Supplemental information (FW/tool version etc.)

Please provide more detailed information here.

  • Answer # 1

    I tried to rewrite the file API that was not standardized.
    The local file specified in the dialog is read and drawn.

    
    
        
        
        Real Chart
    
    
        
         
        
        
        
        
    
    

  • Answer # 2

    The computer where the CSV file is stored is the same as the computer running the web browser displaying the HTML file as written in the question. If it is the same thing, I think that it is better to set up (run) the web server on that personal computer.

    If you are using a Mac or linux-based OS, a web server program called Apache will be included from the beginning, and if you are using a Windows computer, a web server program called IIS will be included from the beginning. Is easy to run (there are plenty of web pages that describe how to run Apache and IIS)

    If you put a copy of the CSV file saved on your computer (assuming the file name is "abc.csv") under the directory where the Web server data will be placed, you can use "https: // localhost/It will be accessible with the URL "abc.csv".

    With these preparations,

    In the question HTML

    anychart.data.loadCsvFile ("https://cdn.anychart.com/charts-data/data_csv.csv", function (data) {


    anychart.data.loadCsvFile ("https: //localhost/abc.csv", function (data) {



    The action of "reading CSV file on the net and making it into a bar graph" is
    It should change to "Read a CSV file on your PC and make it a bar graph".

    ===