WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Error "There was an error loading the data: csv"

[Resolved] Error "There was an error loading the data: csv"

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author thmufl

    @thmufl

    Hi,

    Looks like the plugin tries to load a remote csv file. Did you enter a # before the id in the csv attribute of the chart?

    I can verify this if you set the debug attribute of the chart to ‘true’ and post the console log.

    Thanks for quick reply.

    I enabled debug and now I am getting these details in Console:

    CLIENT:
    	user-agent: mozilla/5.0 (x11; linux i686) applewebkit/537.31 (khtml, like gecko) chrome/26.0.1410.63 safari/537.31
    	touch device: false
    	SVG support: true
    	screen width/height: 1600px/900px
    PLUGIN:
    	IPU-Chart, Version 0.4
    CALL RENDER CHART:
    	id: chart907205
    	csv: csv
    	type: bar
    	category: name
    	value: value
    	format: %s,%f
    	color: auto
    	style: width:100%;height:300px;
    	title: Set a title
    	description: Set a description
    	sort: none
    	interpolate: linear
    	animate: none
    	img:
    	debug: true
    There was an error loading the data: [object XMLHttpRequest]

    Here is the code I pasted on the page:

    [csv id="data"]
    Country,Population
    China,1343.24
    India,1205.07
    USA,313.85
    Indonesia,248.22
    Brazil,205.72
    [/csv]
    
    [chart csv="#data"
           type="bar"
           category="Country"
           value="Population"
           format="string,float"
           color="auto"
           title="Top five most populous countries of the world..."
           description="The top five most populous countries of the world..."
           sort="Population"
           animate="medium"
           img="https://www.ipublia.com/wp-content/uploads/chart-x1.png"
           debug="true"]

    I got it working.
    the chart shortcode content should be in one line. So I write this code in page content area:

    [csv id="data1"]
    Country,Population
    China,1343.24
    India,1205.07
    USA,313.85
    Indonesia,248.22
    Brazil,205.72
    [/csv]
    [chart csv="#data1" type="bar" category="Country" value="Population" format="string,float" color="auto" title="Top five most populous countries of the world..." description="The top five most populous countries of the world..." sort="Population" animate="medium" img="https://www.ipublia.com/wp-content/uploads/chart-x1.png" debug="true"]

    And the chart is working.

    I think you need to update your example shortcode.

    Plugin Author thmufl

    @thmufl

    Thanks!

    The linefeeds in the documentation are for legibility. Please enter the data like this:

    [csv id='data']Country,Population
    China,1343.24
    India,1205.07
    USA,313.85
    Indonesia,248.22
    Brazil,205.72[/csv]

    And remove the linefeeds between the attributes like:

    [chart csv="#data" type="bar" category="Country" ...]

    Don’t forget the # to reference the csv data (from the log it seems that it is missing). It indicates that the data is local (vs remote by url).

    Plugin Author thmufl

    @thmufl

    Yes, I’ll clarify this. I voted for legibility of the code… but it’s confusing.

    Thanks for the helpful feedback! Hope you enjoy the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Error "There was an error loading the data: csv"’ is closed to new replies.