Home Forums Chart Support Data Store

Data Store

Viewing 5 posts - 1 through 5 (of 5 total)
  • #11482

    I am fairly new to Javascript and Graphs. I have the following HTML code which works fine:

    <script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
    <script type="text/javascript">
    window.onload = function () {
    	var chart = new CanvasJS.Chart("chartContainer", {
    		zoomEnabled: true,
    		animationEnabled: true,
    		exportEnabled: true,
    			title: "Job Manager",
    			title: "Error Count"
    			text: "Epoch User Errors"              
    		data: [              
    			type: "column",
    			dataPoints: [
    {label: "Robert Allen", y: 20},
    {label: "Jade Parry", y: 12},
    {label: "Stephen Press", y: 12},
    {label: "Andrea Hilton", y: 11},
    {label: "Victor Field", y: 10},
    {label: "Samantha Simpson", y: 9},
    {label: "Amanda Calvert", y: 7},
    {label: "Chris Sykes", y: 6},
    {label: "Debbie Lynch", y: 6},
    {label: "Carol Nunley", y: 6},
    {label: "Alexander Mcdonald", y: 5},
    {label: "Dani Leman", y: 5},
    {label: "Debbie Cloke", y: 4},
    {label: "John Hanson", y: 4},
    {label: "Rita Upton", y: 4},
    {label: "Toby Graveling", y: 4},
    {label: "Samantha James", y: 3},
    {label: "Spencer Holloway", y: 3},
    {label: "Nicky Byrne", y: 3},
    {label: "Derek Eaton", y: 2},
    {label: "Matthew Beale", y: 2},
    {label: "Sonia Downes", y: 2},
    {label: "Daniel King", y: 1},
    {label: "Elaine George", y: 1},
    {label: "Julie Brooks", y: 1},
    {label: "Tina Morley", y: 1}
    <div id="chartContainer" style="height: 550px; width: 100%;"></div>

    but I want to store the data in a csv file, so I can update it on a regular basis. In the following format

    Robert Allen,20
    Jade Parry,12

    How can I go about doing this. Any help will be appreciated.





    You can use use jQuery.ajax() to get data from external csv file and pass it to chart. Check this jsfiddle.


    Thank you. Sorry but would you know how I can put this into my code. I have been trying with no success.

    As I say I am fairly new to this.


    Check these links for your working code. Data from external CSV, Data saved as String.


    Thanks for that.
    My csv file is in a drive on my companies network, in the same folder as my HTML coding. when I change the URL to the drive, it doesn’t work?

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

You must be logged in to reply to this topic.