{"id":18190,"date":"2019-06-27T15:00:00","date_gmt":"2019-06-27T13:00:00","guid":{"rendered":"http:\/\/www.highcharts.com\/blog\/?p=18190"},"modified":"2026-01-12T11:31:33","modified_gmt":"2026-01-12T11:31:33","slug":"how-to-integrate-highcharts-editor-into-tinymce-editor","status":"publish","type":"post","link":"https:\/\/www.highcharts.com\/blog\/integration\/how-to-integrate-highcharts-editor-into-tinymce-editor\/","title":{"rendered":"How to integrate Highcharts editor into TinyMCE editor"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.tiny.cloud\/\">TinyMCE<\/a> is an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Online_rich-text_editor\">online rich-text editor<\/a> released as open-source software under the LGPL. It makes it easy to convert HTML textarea fields or other HTML elements into WYSIWYG editor instances. And in this tutorial, we will show you how to integrate the <a href=\"http:\/\/editor.highcharts.com\/?_ga=2.19939068.57105024.1560699161-1141631896.1538053723\">Highcharts Charts Editor<\/a> with the TinyMCE editor using a simple plugin. This will allow you to create interactive charts within the TinyMCE editor, and embed those charts wherever the TinyMCE editor is used.<\/p>\n<p>The integration in the example below is done on your local machine, but the exact same steps apply for your production application.<\/p>\n<p><i><b>Remark<\/b><br \/>\nYou need to have a web server to run and test the integration. In this tutorial, I use the Brackets editor since it offers a live preview using an internal web server.<br \/>\n<\/i><\/p>\n<p>Let\u2019s get started.<\/p>\n<h4>Architecture<\/h4>\n<p>To give you an idea about the global architecture, let\u2019s take a look at the picture below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18196\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11.jpg\" alt=\"\" width=\"965\" height=\"307\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11.jpg 965w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11-560x178.jpg 560w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11-768x244.jpg 768w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11-760x242.jpg 760w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27112404\/How-to-integrate-Highcharts-editor-into-TinyMCE-editor-11-360x115.jpg 360w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/p>\n<p>The global architecture is simple; there are three main components:<\/p>\n<ul>\n<li>Highcharts editor<\/li>\n<li>TinyMCE plugin<\/li>\n<li>TinyMCE editor<\/li>\n<\/ul>\n<p>The TinyMCE plugin is the interface\/link between the Highcharts editor and the TinyMCE editor.<br \/>\nThe Highcharts editor plugin includes the Highcharts editor and the TinyMCE plugin.<\/p>\n<p>Now, you have an idea about the main components; let\u2019s set up the project.<\/p>\n<p>First, let\u2019s create a folder where we\u2019ll gather and run the project; then download the Highcharts editor and the TinyMCE plugin from this <a href=\"https:\/\/github.com\/highcharts\/highcharts-editor\/releases\">link<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18200\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58.jpg\" alt=\"\" width=\"984\" height=\"740\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58.jpg 984w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58-560x421.jpg 560w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58-768x578.jpg 768w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58-760x572.jpg 760w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27132819\/Screenshot-2019-06-27-at-13.26.58-360x271.jpg 360w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/p>\n<p>In the <code>highcharts-editor.min.dist<\/code>, you will find the Highcharts editor and the CSS file as well.<br \/>\nTo set up the TinyMCE editor, you need the link to the editor and the <code>tinymce.init<\/code> function. To do that, create an <code>index.html<\/code> file, then add the following script: <code>&lt;script src='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/tinymce\/5.0.6\/tinymce.min.js'&gt;&lt;\/script&gt;<\/code>, and create a file <code>main.js<\/code>, then copy\/paste the following code for TinyMCE version 5:<\/p>\n<pre>tinymce.init({\r\n  selector: \"#chart-result\",\r\n  plugins: [\r\n    \"advlist autolink lists link image charmap print preview anchor\",\r\n    \"searchreplace visualblocks code fullscreen\",\r\n    \"insertdatetime media table contextmenu paste\",\r\n    \"highcharts highchartssvg noneditable\"\r\n  ],\r\n  toolbar: \"insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image\",\r\n  menubar: \"file edit insert view format table tools help highcharts\",\r\n  menu: {\r\n    highcharts: {\r\n      title: \"Highcharts\",\r\n      items: \"highcharts\"\r\n    })\r\n});<\/pre>\n<p>In case you are using TinyMCE version 4, copy\/paste this code:<\/p>\n<pre>tinymce.init({\r\n  selector: '#chart-result',\r\n  height: 550,\r\n  plugins: [\r\n    'advlist autolink lists link image charmap print preview anchor',\r\n    'searchreplace visualblocks code fullscreen',\r\n    'insertdatetime media table contextmenu paste',\r\n    'highcharts highchartssvg noneditable'\r\n  ],\r\n  toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'\r\n});<\/pre>\n<p><i><b>Remark<\/b><br \/>\nIn case you previously used TinyMCE version 4, note that version 5 API introduces several changes, including adding new options to the toolbar. Instead of having the Highcharts plugin integrated into an existing menu, we need to create a separate menu option for it:<\/i><\/p>\n<ul>\n<li>How to access to the Highcharts editor TinyMCE version 4.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-18206\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4.jpg\" alt=\"\" width=\"75%\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4.jpg 800w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4-560x280.jpg 560w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4-768x384.jpg 768w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4-760x380.jpg 760w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134527\/version-4-360x180.jpg 360w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n<li>How to access to the Highcharts editor TinyMCE version 5.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-18207\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5.jpg\" alt=\"\" width=\"75%\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5.jpg 800w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5-560x280.jpg 560w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5-768x384.jpg 768w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5-760x380.jpg 760w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2019\/06\/27134538\/version-5-360x180.jpg 360w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n<\/ul>\n<p>To have access to different Highcharts charts\u2019 types and options add the following libraries and modules:<\/p>\n<ul>\n<li>highstock.js<\/li>\n<li>highcharts-more.js<\/li>\n<li>highcharts-3d.js<\/li>\n<li>modules\/data.js<\/li>\n<li>module\/exporting.js<\/li>\n<li>modules\/funnel.js<\/li>\n<li>modules\/solid-gauge.js<\/li>\n<\/ul>\n<p>The final <code>index.html<\/code> will look like:<\/p>\n<pre>&lt;html&gt;\r\n\r\n  &lt;link href=\"highcharts-editor.min.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n  &lt;script src=\"http:\/\/code.highcharts.com\/stock\/highstock.js\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/modules\/data.js\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/highcharts-more.js\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/highcharts-3d.js\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/modules\/exporting.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/modules\/funnel.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.highcharts.com\/modules\/solid-gauge.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"highcharts-editor.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/tinymce\/5.0.6\/tinymce.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"highcharts-editor.tinymce.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"main.js\"&gt;&lt;\/script&gt;\r\n\r\n  &lt;body&gt;\r\n    &lt;textarea id=\"chart-result\"&gt; &lt;\/textarea&gt;\r\n  &lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<p>That is it; all the components are set up. Now, all I have to do is to run the project using the live preview option in Brackets.<\/p>\n<p>&nbsp;<\/p>\n<p>You can also try the live versions on <a href=\"https:\/\/codesandbox.io\/s\/how-to-integrate-highcharts-editor-into-tinymce-editor-kgg89\">CodeSandBox<\/a>. Click on the Highcharts and add your own interactive chart into the TinyMCE ediot:<\/p>\n<p><iframe style=\"width: 100%; height: 700px; border: 0; border-radius: 4px; overflow: hidden;\" title=\"How to integrate Highcharts editor into TinyMCE editor\" src=\"https:\/\/codesandbox.io\/embed\/static-kgg89?fontsize=14&amp;view=preview\" sandbox=\"allow-modals allow-forms allow-popups allow-scripts allow-same-origin\"><\/iframe><\/p>\n<p>Feel free to share your questions and experiences in the comment field below; I will be happy to answer you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A step by step tutorial to learn how to integrate Highcharts into the TinyMCE editor.<\/p>\n","protected":false},"author":32,"featured_media":21959,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"meta_title":"","meta_description":"","hc_selected_options":[],"footnotes":""},"categories":[1105],"tags":[1094],"coauthors":[699],"class_list":["post-18190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integration","tag-highcharts-core"],"_links":{"self":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/18190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/comments?post=18190"}],"version-history":[{"count":1,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/18190\/revisions"}],"predecessor-version":[{"id":29206,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/18190\/revisions\/29206"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media\/21959"}],"wp:attachment":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media?parent=18190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/categories?post=18190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/tags?post=18190"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/coauthors?post=18190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}