Table2Chart: a WordPress Plugin to draw charts

Very short description: Table2Chart is a WordPress plugin which enables a shortcode to draw an interactive chart.

More detailed description: In the basic form the shortcode read the numerical data of a table and represents them in an interactive chart allowing to customize its type (horizontal bars, vertical bars, line, area, scatterplot, bubble plot) and some main options (size, titles and colours). In the advanced form the shortcode allows to configure every chart property (labels, legend, animation, area style, etcetera) and even it does not require a table at all. The plugin uses the Javascript HighCharts library, which is free only for personal and non profit websites, to draw the charts. Readers will refer to its web site for more information and license details.

Basic use

In its simplest version the shortcode

[Table2Chart]

draws the chart corresponding to the first table in the post with default parameters. It is possible to specify additional attributes in self enclosing form, as for example

[Table2Chart width="600" background="#808080"]

The complete list of attributes which can be set up includes:

attribute description default value
table number which indicates the cardinal position of the table (first, second, etcetera) in the post to gather the data from (set zero for no table; see under advanced use section) 1
width chart width in pixel 500
height chart height in pixel 400
type chart type to choose from bar (horizontal bars), column (vertical bars), line, area, scatterplot, bubble column
title chart title (empty)
subtitle chart subtitle (empty)
titleX category axis title (empty)
titleY value axis title (empty)
order row if series lie on rows, column if they lie on columns column
namecol position of the row containing the series or category titles 1
namerow position of the column containing the series or category titles 1
background background color in hexadecimal format #ffffff
color colors of data series #ff0000,#00ff00,#0000ff,
#00ffff,#ff00ff,#ffff00
convert true if numerical values in the table are in continental format and they have to be converted in JS format (dot as decimal separator and comma as thousand separator), false otherwise true
hide true to hide the table whose data are read, false otherwise false

Let see some simple examples using sample data gathered from eurostat. The following table shows the distribution of energy consumption by sector in three European Countries (2011):

industry transport residential services other
Spain 24% 42% 19% 11% 4%
Italy 25% 34% 26% 13% 2%
Romania 31% 23% 35% 8% 3%

Shortcode [Table2Chart] returns:

and shortcode [Table2Chart type="line" order="row" background="#b0b0b0"] returns

The following table lists the natural and migration relative balances besides the population amount in the 17 country of Euro Zone (2011):

Country natural change rate net migration rate population (millions)
Belgium 0,21% 0,65% 11,0
Germany -0,23% 0,34% 81,8
Estonia -0,04% 0,00% 1,3
Ireland 1,00% -0,73% 4,6
Greece -0,04% -0,13% 11,3
Spain 0,18% -0,09% 46,2
France 0,43% 0,08% 65,0
Italy -0,08% 0,40% 60,6
Cyprus 0,48% 2,13% 0,8
Luxembourg 0,35% 2,12% 0,5
Malta 0,24% 0,17% 0,4
Netherlands 0,27% 0,18% 16,7
Austria 0,02% 0,44% 8,4
Portugal -0,06% -0,23% 10,6
Slovenia 0,16% 0,10% 2,1
Slovakia 0,17% 0,05% 5,4
Finland 0,17% 0,31% 5,4

Shortcode [Table2Chart table="2" type="bubble" titlex="natural change %" titley="net migration rate %" background="#f0f0ff" color="#00d000"] returns


Notice that in every chart hovering on a bar/marker displays a detailed tooltip, whereas clicking on any item in the legend alternatively hides or shows the corresponding data series.

Advanced use

The shortcode enclosing form allows to specify many other chart properties which cannot be set up by attributes. For example

[Table2Chart type="scatter" table="2" titlex="natural change %" titley="net migration rate %" background="#f0f0ff" color="#00d000"]
legend: {enabled:false}
[/Table2Chart] 

hides the chart legend in the scatterplot corresponding to previous bubble chart, which otherwise would displays the title of third column in data table.



In a similar way it is possible to specify any chart detail. The syntax to use is very easy, since it follows exactly that of HighCharts library whose simplicity is the main reason that made me loving it when I discovered it. Formally, the string between the opening and closing shortcode tags is interpreted as the content of a JavaScript object literal; in plain words, it has to be written as a comma separated list of name value pairs, wrapped in curly braces when nested. The complete list of chart properties customizable by such pairs is described with interactive examples on HighCharts API page.
It is not customary to know JavaScript, but it is fundamental to understand HighCharts API, browsing its page and try its online sample.
The following examples answer some demands I have received from people using earlier plugin versions.
In a column chart like the first one, hiding credit link (even if I don’t like to do so) requires to write

[Table2Chart]
credits:{enabled:false}
[/Table2Chart]


whereas displaying data values (even if it violates Tufte’s sufficiency principle) requires to write

[Table2Chart]
plotOptions: {series: {dataLabels: {enabled: true}}}
[/Table2Chart]


Obviously it is possible to set more than one property at a time. For example, from the Highcharts demo page, choose Scatter plot, then Gray.
To apply the same style to the already seen scatterplot, it suffices to click on the View visual theme button, then copy all the content inside the outest curly brackets and paste it between the same previous opening and closing shortcode tags (important: after removing all empty lines!).

[Table2Chart type="scatter" table="2" type="bubble" titlex="natural change %" titley="net migration rate %" background="#f0f0ff" color="#00d000"]
   colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee",
      "#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
   chart: {
      backgroundColor: {
         linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
         stops: [
            [0, 'rgb(96, 96, 96)'],
            [1, 'rgb(16, 16, 16)']
         ]
      },
      borderWidth: 0,
      borderRadius: 15,
      plotBackgroundColor: null,
      plotShadow: false,
      plotBorderWidth: 0
   },
   title: {
      style: {
         color: '#FFF',
         font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
      }
   },
   subtitle: {
      style: {
         color: '#DDD',
         font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
      }
   },
   xAxis: {
      gridLineWidth: 0,
      lineColor: '#999',
      tickColor: '#999',
      labels: {
         style: {
            color: '#999',
            fontWeight: 'bold'
         }
      },
      title: {
         style: {
            color: '#AAA',
            font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
         }
      }
   },
   yAxis: {
      alternateGridColor: null,
      minorTickInterval: null,
      gridLineColor: 'rgba(255, 255, 255, .1)',
      minorGridLineColor: 'rgba(255,255,255,0.07)',
      lineWidth: 0,
      tickWidth: 0,
      labels: {
         style: {
            color: '#999',
            fontWeight: 'bold'
         }
      },
      title: {
         style: {
            color: '#AAA',
            font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
         }
      }
   },
   legend: {
      itemStyle: {
         color: '#CCC'
      },
      itemHoverStyle: {
         color: '#FFF'
      },
      itemHiddenStyle: {
         color: '#333'
      }
   },
   labels: {
      style: {
         color: '#CCC'
      }
   },
   tooltip: {
      backgroundColor: {
         linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
         stops: [
            [0, 'rgba(96, 96, 96, .8)'],
            [1, 'rgba(16, 16, 16, .8)']
         ]
      },
      borderWidth: 0,
      style: {
         color: '#FFF'
      }
   },
   plotOptions: {
      series: {
         shadow: true
      },
      line: {
         dataLabels: {
            color: '#CCC'
         },
         marker: {
            lineColor: '#333'
         }
      },
      spline: {
         marker: {
            lineColor: '#333'
         }
      },
      scatter: {
         marker: {
            lineColor: '#333'
         }
      },
      candlestick: {
         lineColor: 'white'
      }
   },
   toolbar: {
      itemStyle: {
         color: '#CCC'
      }
   },
   navigation: {
      buttonOptions: {
         symbolStroke: '#DDDDDD',
         hoverSymbolStroke: '#FFFFFF',
         theme: {
            fill: {
               linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
               stops: [
                  [0.4, '#606060'],
                  [0.6, '#333333']
               ]
            },
            stroke: '#000000'
         }
      }
   },
   // scroll charts
   rangeSelector: {
      buttonTheme: {
         fill: {
            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
            stops: [
               [0.4, '#888'],
               [0.6, '#555']
            ]
         },
         stroke: '#000000',
         style: {
            color: '#CCC',
            fontWeight: 'bold'
         },
         states: {
            hover: {
               fill: {
                  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                  stops: [
                     [0.4, '#BBB'],
                     [0.6, '#888']
                  ]
               },
               stroke: '#000000',
               style: {
                  color: 'white'
               }
            },
            select: {
               fill: {
                  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                  stops: [
                     [0.1, '#000'],
                     [0.3, '#333']
                  ]
               },
               stroke: '#000000',
               style: {
                  color: 'yellow'
               }
            }
         }
      },
      inputStyle: {
         backgroundColor: '#333',
         color: 'silver'
      },
      labelStyle: {
         color: 'silver'
      }
   },
   navigator: {
      handles: {
         backgroundColor: '#666',
         borderColor: '#AAA'
      },
      outlineColor: '#CCC',
      maskFill: 'rgba(16, 16, 16, 0.5)',
      series: {
         color: '#7798BF',
         lineColor: '#A6C7ED'
      }
   },
   scrollbar: {
      barBackgroundColor: {
            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
            stops: [
               [0.4, '#888'],
               [0.6, '#555']
            ]
         },
      barBorderColor: '#CCC',
      buttonArrowColor: '#CCC',
      buttonBackgroundColor: {
            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
            stops: [
               [0.4, '#888'],
               [0.6, '#555']
            ]
         },
      buttonBorderColor: '#CCC',
      rifleColor: '#FFF',
      trackBackgroundColor: {
         linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
         stops: [
            [0, '#000'],
            [1, '#333']
         ]
      },
      trackBorderColor: '#666'
   },
   // special colors for some of the demo examples
   legendBackgroundColor: 'rgba(48, 48, 48, 0.8)',
   legendBackgroundColorSolid: 'rgb(70, 70, 70)',
   dataLabelsColor: '#444',
   textColor: '#E0E0E0',
   maskColor: 'rgba(255,255,255,0.3)'
[/Table2Chart] 


The following case copies out previous line chart putting an entry in the legend to toggle visibility of all data series. Since it is a bit elaborate it deserves some explanation.

[Table2Chart type="line" order="row" background="#b0b0b0"]
series:[,,,
{
    type:'scatter',
    name:'hide all',
    marker: {enabled: false}, 
    events: {legendItemClick: function(event) {
        var leg=this;
        jQuery.each(leg.chart.series, function (i, serie) {
            if (serie.index != leg.index) {
                if (leg.name == 'hide all') serie.hide();
                else serie.show()
            }
        });
        if (leg.name == 'hide all') leg.update({name: 'show all'});
        else {leg.update({name: 'hide all'})};
        return false;
    }}
}
]
[/Table2Chart]



The series collection contains all the information about the data series to chart. In all standard cases it’s the plugin that takes care of building it according to table data and shortcode attributes. So in the above shortcode enclosed content, opening commas leave the first three series elements untouched while following lines add a dummy fourth series: name property is set to display a proper text in the legend; type and marker are set to hide the marker in the legend; eventually the function defined for legendItemClick event alternately displays or hides all the chart series when clicking on the corresponding legend item. This is a little piece of code but inevitably it requires a bit of JavaScript knowledge.

As can be guessed the possible customizations are virtually endless. Since the series.data property allows to specify the value set to draw in che chart, it is even possible to dismiss the table. To do this way the shortcode attribute table has to be set to 0 (zero). As a last example for this case consider a dynamic chart whose main code is banally copied from another demo on Highcharts site.

[Table2Chart table="0"]
            chart: {
                type: 'spline',
                animation: Highcharts.svg, // don't animate in old IE
                marginRight: 10,
                events: {
                    load: function() {
                        // set up the updating of the chart each second
                        var series = this.series[0];
                        setInterval(function() {
                            var x = (new Date()).getTime(), // current time
                                y = Math.random();
                            series.addPoint([x, y], true, true);
                        }, 1000);
                    }
                }
            },
            title: {
                text: 'Live random data'
            },
            xAxis: {
                type: 'datetime',
                tickPixelInterval: 150
            },
            yAxis: {
                title: {
                    text: 'Value'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'<br/>'+
                        Highcharts.numberFormat(this.y, 2);
                }
            },
            legend: {
                enabled: false
            },
            exporting: {
                enabled: false
            },
            series: [{
                name: 'Random data',
                data: (function() {
                    // generate an array of random data
                    var data = [],
                        time = (new Date()).getTime(),
                        i;
                    for (i = -19; i <= 0; i++) {
                        data.push({
                            x: time + i * 1000,
                            y: Math.random()
                        });
                    }
                    return data;
                })()
            }]
[/Table2Chart]



When engaging in an advanced chart, my suggestion is to start with an entry on Highcharts API, follow the link on jfiddle site to try the corresponding example, change the code as needed and test it until it works, without worrying if this does not happen on the first go :) ; then, copy it and paste it as shortcode enclosed content.

installation instructions

To install the plugin download it from the below link and then upload and activate it from the administration panel in WordPress.

Download Table2Chart 0.5


55 pensieri su “Table2Chart: a WordPress Plugin to draw charts

  1. Hi Antonio,

    Great update! I am glad that you got it up and working. The new customizations look great and without limits. Well done.

    The new feature of “hide all” works! But it doesn’t work very well. I have tried it now in Firefox and Chrome. In Chrome, it does successfully hide all data points, but only after 15 seconds or so. The tab that is open just freezes as it executes the jquery command that hides all data points. In Firefox, when I click on ‘hide all’, it begins to execute the command, but then Firefox prompts the user and says there is an unresponsive script running. If I press ‘continue’, the script continues to hide data points until Firefox prompts the user once again and with the same error message. However, if I hit continue, it does hide all of the data points.

    I guess that when you have as many data points as I do, it takes a long time to hide all of the data. Do you think I can correct this issue? Have a look at my web site.

    Thanks so much for all of your hard work! This is great…
    Eric
    Pasadena, CA

    • Javascript is lazy but not so lazy…
      In order to identify the source of your problem I suggest you to apply the code to a simplified version of your chart. Try first with 5, then 10, then 15 data series, and so on. Moreover, notice that you are creating the “hide all” item destroying the first series! You have to input as many commas as the number of data series you have, just after the first “[“. So, if you try with 5 series, you have to write “[,,,,,”. Let me know.

  2. Pingback: da tabella a grafico in Wordpress | sei-uno-zero-nove

  3. This is the best charting plugin I’ve found for WP!
    I’m displaying a table that has several columns of prices. When I try to chart those columns, the values are changed from, for example, 22.5 to 225
    Can you help me correct this?

    • Which value has your CONVERT parameter?
      Have you tried with [table2chart convert=true] ?
      Otherwise, please send me the link of your page containing the chart. Thank you.

      • Aha! Adding the attribute convert=”false” does the trick! Now all my prices are displaying correctly when charted. Thank you, I knew it had to be something simple!

        I noticed that I can create a pie chart using the attribute type=”pie”. It looks like the labels don’t work yet for pie charts. I’ve tried many chart plugins for WP and this one is the best by far! I can’t wait to see what you have planned in the next release – I hope it’s pie charts!

      • If you have read my original article, you should know that I don’t like
        pie charts. :)
        Anyway, as you have recognized, it is already possible to draw such a chart. And if you use the enclosing form for your shortcode, you can set labels like you desire.

  4. Awsome plugin Antonio. Using it in our site now. How can we display the name in columns at 90 deg angle. for eg I show 10 columns but each name is pretty big so it kind of overlaps. If I show the name at 90 degree angle, that should solve the problem

      • Where will this code go ? Right now I am creating a wordpress post and using Table2 chart with abase plugin for eg
        [abase select=”name as Name , student as Total_Students” from=”college”]

        [Table2Chart width=”600″ background=”#f0f0ff” color=”#00d000,#00ffff,#ff00ff,” ]

      • Inside the opening and closing shortcode tag, as explained in the
        “advanced use” section of this page:
        [Table2Chart width=”600″ background=”#f0f0ff”
        color=”#00d000,#00ffff,#ff00ff,” ]
        put your code here
        [/Table2Chart]

  5. Hi again!

    Is there a way to exclude the last row of the table? I have a page template that populates a table with database values. Sometimes the tables have 7 rows, sometimes they have 11 rows – it’s different each time. The final row of the table is always totals from the table columns. I need a way to exclude the last row so it doesn’t mess up the scale of the chart. At the moment I’m displaying the totals in a single row of a second table, but it’s not the best solution.

    • I found I can use the table header tag to show the last row of the table so that is not incorporated into the chart. It’s still not the perfect solution, but it works better than a second table.

  6. Thank you for sharing your solution. Indeed, there wouldn’t be a simple option to exclude the last row if the table is dynamically build and the number of rows changes from time to time.

  7. Antonio, do you have a solution for rendering the chart as images on the wordpress ? I could figure out a link on right which helps downlaod the chart as images This is example
    http://greprep.info/2014/04/21/top-10-post-with-link/
    Look on the right of the chart “Top 10 colleges with international student in MA ”
    I would like to have the chart rendered as image on wordpress so that users can share them. Do we have a way out ?
    I do not want to render charts as image on server.

    • > I would like to have the chart rendered as image on wordpress
      > so that users can share them. Do we have a way out ?
      > I do not want to render charts as image on server.

      It is not possible, by design.
      Render the chart as an image means work on the server side.
      Render the chart as a dynamic element of an html page means rely on the
      client side. There are libraries that create charts as swg elements
      (like in this plugin) and other ones that create charts as canvas elements.
      The button to download the chart as an image is the maximum you can get.

      • At present the plugin does not provide for it. I will add this feature in the next version. Or, if you want, I can give you the instructions to add it manually to the current version.

  8. Great plugin! Just one minor bug I discovered. If the table contains a footer (tfoot), the data don’t get interpreted correctly.

    Grazie mille,

    Chris

    • Thanks for your warning.
      Have you a link to highlight or can you post the html code of the table
      which raises the issue?

  9. Hi, I’d like to customise the credit line and values formating using Highchart API, from the shortcode (in the code tab of the wordpress text editor) : [Table2Chart excludecols=”2″ height=”200″ titley=”Effectif” includecols=”5″ color=”#a89957″]credits:{enabled:false}[/Table2Chart]

    but whenever I replace credits:{enabled:false} with something using ‘ to define parameters the graph disappears. It seems the ‘ is replaced by the character ascii code…

    Do you know where I should find the error ?

    Thanks a lot !

    • I am unable to reproduce what you point out. Can you make an example writing the precise content of your shortcode?

    • No, sure not. Currently I have it running on a 4.1 WP (updated from 4.0) website and it’s all ok. Maybe have you changed some other thing?

  10. Works great in wp4.1. What would my table look like to have two series in a scatter chart.
    I want a scatter chart with markers colored according to column cat

    now i have all the same colors using this table
    item x y cat
    test1 1 1 a
    test2 1 2 b
    test3 1 3 a

    thanks

  11. Great plugin! Was looking for something like this for the last weeks, will now check if I can get my spider and polar charts visible in WP with this ;)

    Btw – one little request for https websites… can you change “http://code.highcharts.com/” into “//code.highcharts.com/”?

    In that case it will use either the http:// OR the https:// version of the source file (both exist). So if you have your website accessible via http it will load http://code.highcharts.com and when the website is accessible via https it will load https://code.highcharts.com. This prevents SSL / https warnings/errors. Thanks!

  12. Hi Antonio,

    I’ve read you’re not font of pie charts :-). I’ve seen that it’s possible to create one but it’s not respecting the default colors. It’s just display random colors. Is it possible to change this?

    Thanks in advance

  13. Hello!
    Firstly, your plug-in is amazing, I didn’t think I would find just exactly what I was looking for! You can custom it, with a lot of options and it works great in my website. Only, a little problem I found: for some reason, in my chart, the amounts in thousands don’t appear, it only appears something like 1K 2K, 3K, etc.. I don’t know what to change: I selected convert true, false, quantities with dots, with commas, but I don’t get to show thousands. Nowadays, my numbers use dots and convert is true; with convert in false it understood it was decimals.
    Do you know what is happening?
    Thanks a lot!

    • Sorry for my tardy reply, I am very busy at work in this period. You can try the enclosed form with:
      yAxis: {
      labels: {format:'{value:,.0f}'}
      }

      • Hey, thank you very much! That worked perfectly!
        By the way, why dots don’t appear in thousands? And could I make the yAxis begin always with 0?
        Thanks one more time and no need to hurry! :-)
        (You can delete the message below, I made a mistake about where to answer)

      • yAxis: {
        labels: {format:'{value:,.0f}'},
        min: 0
        }

        Sorry, in this version it is not possible to have dots as thousand separators.

  14. Hello Antonio,

    your plugin is exactly what I’m looking for! Great work!

    Unfortunately the download link doesn’t work, it says “404 file not found”. Is there another way to get your plugin?

    Thank you very much!
    Anna

    • Sorry, the plugin has been removed from WordPress plugins directory because Highcharts license (CC) is not compatible with WordPress license (GPL). It is not possible for me to resolve the issue. Anyway if you want to try the last available version it I have updated the download link.

  15. Buongiorno Antonio,

    non so se rispondi ancora a delle domande su questo plugin (nice job btw, thanxx !), but just in case :

    I’m trying to create a column type chart, things going Ok except that I can’t change the xAxis labels colours.

    If I leave the style: { } empty (see below) then the graph draws Ok (but no color of course, well just the default grey), but as soon as I enter color:’red’ or color:’ff0′ inside the brackets, the plot doesn’t show up anymore…
    (btw I get an error msg in the console which points to Table2Chart.js, but on a commented line – makes no sense)

    Here’s the Table2Chart code I have in WP, let me know if you’re still here ^^ and need the table data – grazie tanto ! :)

    [Table2Chart table=”1″ hide=”true” convert=”false” order=”row” title=”Moyennes des Notes – Saison 2017-2018″ titley=”Moyennes” width=”640″ color=”blue”]
    plotOptions: {
    series: {
    dataLabels: {
    enabled: true
    }
    }
    },
    xAxis: {
    labels: {
    style: {
    color: ‘#f00’
    }
    }
    }
    [/Table2Chart]

    • Strange…
      Try to remove all unnecessary lines:
      xAxis: {
      labels: {
      style: {
      color: ‘#f00’
      }
      }
      }
      then try to use “red” instead of ‘red’.
      Does it change something?

  16. I have tried to enter a new comment, but it never appears here… :(

    So this is another trial, with a dummy email address. (I put a real email address on my 1st msg of course)

    Is this message going to appear in this page…?

    • Please be patient, you have to give me the time to approve your message (I’m borbarded of spam messages). :)

  17. Oops… mi dispiace, I didn’t know you moderated the messages before they appear here… :/

    Btw as you probably understood, I’m the impatient one who first posted the long msg about xAxis labels colours. :)

    Btw², we’re using WordPress 4.9.7.

  18. Ok thanks for the answer.

    I have tried what you posted (removed the plotOptions block), also with “red” in double-quotes, still does not work.

    I even reduced the xAxis instruction to a single line : (normally this would be a multi-line, indented JSON type code)

    [Table2Chart table=”1″ hide=”true” convert=”false” order=”row” title=”Moyennes des Notes – Saison 2017-2018″ titley=”Moyennes” width=”640″ color=”blue”]
    xAxis: { labels: { style: {color: “red”}}}
    [/Table2Chart]

    but it didn’t help (as expected, but ya never know).

    Hopefully we can get this to work, I would also love to be able to do “boxplot” type graphs if possible via your plugin.

    • Very strange…
      Read the source code of the page. Which scripts do you have just before the footer? Is there one that points to https://code.highcharts.com/highcharts.js?
      If yes, send me your table code (with dummy data, if necessary) and I take a look.
      Box-plot? Ahah! It’s possible, but complex. :) You’d better to build only the JS(ON) code first, looking for help at stackoverflow. Then put the code in WP editing page, and voilà.

  19. I just typed a complete answer, but when I sent i , it got lost with a weird error mesg ” potential risk bla bla…” :-/
    (oh I understand now, it’s the script thing below, so I just inserted a space after the <)

    So I'll make it short (for a change ^^) :
    yes there is a link to HighCharts in the WP page source text/code :

    and one to Table2Chart.js of course (but installed locally).

    Can I mail you the code with table data to yr email address instead of here ?

    Would be great if I can do boxplots, if not too too complicated…

    • Well, I have identified the source of the issue: WP automatically translates quotes into smart quotes. To avoid this, follow the indications of https://www.webhostinghero.com/remove-smart-quotes-from-wordpress/, for example. If you are unable, I will embed all the needed work into my plugin source code. Regarding box-plot, now, after having seen your data, I have understood that it would be too complex to do it with my plugin. It would be much easier to make the chart using Excel, really.
      Thank you for your patience and understanding.

      • Hi Antonio,

        yep, the trick from the web site you mentioned works – thanxx ! (though I don’t quite understand why this texturizer thing doesn’t affect the rest of the code in the article, for instance the at the beginning, not to mention the shortcode which is full of ” ” quotes…

        However I’ll have to ask my writers friends (the ones that write most of the articles on our website) to see if they’d accept such a change (to disable the WP texturizer entirely), my guess is that it will be a resounding “no way !”.

        But I’ve seen that it’s possible to define which tags are or are not texturized, maybe I’ll try to just use single quotes ‘ in the graph code and define them as “not texturizable” (ouch !), those are seldom used in articles (and frankly, the diff b/w texturized ‘ and non-texturized ‘ is ridiculously small anyway).

        As per the boxplot, I have succeeded in creating a graph pretty much as I wanted – but I’ve done it directly with HighCharts not via your plugin and WP, would be a nightmare to make it work so I’ll just post a PNG image of the graph instead of wasting hours trying to generate a boxplot graph “live” in WP.

        It’s a pity though, should be possible to do whatever one wants – but I’ve had so much trouble inserting scripts/pieces of code within a WP article that tbh I’m quite fed up with it. ;)

        So a big THANK YOU for that solution, and for the time you dedicated to my request, really appreciate it !

      • If you don’t want to disable WP texturizer, please do: from the Admin sidebar: Plugin > Editor > Table2Chart > table2chart.js > replace row 53 with the following one:
        if (fobj) oopt=eval(“({“+fobj.innerHTML.replace(“‘”,”‘”).replace(“’”,”‘”)+”})”);
        Done. If it works (I have verified by myself, but let you see) I can re-zip my plugin.

        P.S.: I will check if WP texturizes my comment, too. :) In case, I will email you the line content to copy and paste. I’m pretty sure that Gmail doesn’t texturizes. :)

  20. I don’t have Admin rights on our website WP so couldn’t find the edit plugin menu, so I… let’s say found a way to do the edit directly in your JS script, and… SUCCESS once again ! :)

    This is great, will allow me to f*ck around with graphs in WP more than I anticipated.

    I’m a tad surprised that you haven’t had that request long time ago, because this issue with WP must stand in the way of programmers, no…?

    Anyway, grazie mille again for the help – I can see you too have a hard time “disconnecting” even in the evenings – as for me, until I have resolved an issue, I just can’t stop… :))

Lascia un commento

Il tuo indirizzo email non sarà pubblicato.

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.