CSV add-on example 1

CSV add-on example 1

CSV add-on allows to draw specific slices of csv file, here all columns from 0 (the first one) to 5 and all rows between 14 and 27 included. 0 is always the first row or column number.
Each column added will create a specific dataset on chart (using label of the first cell of column), and every row will be chart as a specific x-axis value (using label of first cell in row).
An extra parameter is available here information_source which allow to specify (or link to) the source of information used, if not yours.

CSV source file

CSV source file
CSV source file

Chart

[csv2chartjs url="https://maxicharts.com/wp-content/uploads/2017/07/ActiviteUTF8.csv" type="bar" color_set="random" height="600px" delimiter=";" rows="14-27" columns="0-5" chart_js_options="legend: {display: true },title: {display: true, text: 'Activité des 18-50 ans selon l’origine - Hommes'}" yaxislabel="%" information_source='Enquête Trajectoires et Origines, INED-INSEE, 2008.'/]

Here:

  • columns="0-5" : will create 5 datasets, one for each column, using the first cell to create dataset label, here labels are on line 14 (first row in rows parameter)
  • rows="14-27" : each row will add a new x value, labelled with the first cell of row, which is 0 here (see previous parameter), so DOM, Algérie, etc…

About The Author

Comments (2)

  • Keith Davison

    Hello,

    I have managed to implement your graph from a CSV file and it looks great. I have used the rows=”number-number” to limit the amount of data points plotted.

    The CSV I am plotting regularly has additional rows appended to the bottom. I would like the graph to show the last 24 rows.

    I have been unable to work out how to display this as the number of rows is increasing all the time. Is there a command which will allow me to limit the data points to the last 24 rows in the file rather than specifying a specific row number.

    Thanks for your help.

    • MaxiCharts

      Thanks for you feedback Keith!
      What you need is very clear, but unfortunately not available currently. This could be a custom development for you if you need.
      Thanks!