{"id":370,"date":"2022-04-07T11:57:05","date_gmt":"2022-04-07T10:57:05","guid":{"rendered":"http:\/\/modules.bijc.co.uk\/?page_id=370"},"modified":"2026-02-03T16:48:41","modified_gmt":"2026-02-03T16:48:41","slug":"plotly-module","status":"publish","type":"page","link":"https:\/\/modules.bijc.co.uk\/?page_id=370","title":{"rendered":"Plotly Module"},"content":{"rendered":"\n<p>An implementation of the <a href=\"https:\/\/plotly.com\/javascript\/\">plotly.js<\/a> library as a perspective component.<\/p>\n\n\n\n<h3><a href=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2024\/10\/BIJC_Plotly_Component_v1.2.0.zip\">8.1 Module Download Link (Plotly v2.32.0)<\/a><\/h3>\n\n\n\n<p>The 8.1 module is no longer being developed. This download is for legacy systems that require it.<\/p>\n\n\n\n<h3><a href=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2026\/02\/BIJC_Plotly_Component_v2.0.830.zip\">8.3 Module Download Link (Plotly v3.0.8)<\/a><\/h3>\n\n\n\n<p>A single component provides support for all plotly chart types through a flexible set of properties. Seventeen variants are included as examples of creating some of the charts.<\/p>\n\n\n\n<h3><a href=\"https:\/\/plotly.com\/javascript\/\" target=\"_blank\" rel=\"noreferrer noopener\">Plotly.js Documentation<\/a><\/h3>\n\n\n\n<h3><a href=\"https:\/\/plotly.com\/javascript\/reference\/\" target=\"_blank\" rel=\"noreferrer noopener\">Plotly.js Figure Reference Documentation<\/a><\/h3>\n\n\n\n<h3>Property Model<\/h3>\n\n\n\n<p>The component has four properties:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Property<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>data<\/td><td>Array of JSON objects describing the traces ti display on the chart<\/td><\/tr><tr><td>layout<\/td><td>Attributes for the chart<\/td><\/tr><tr><td>config<\/td><td>Configutation for the chart<\/td><\/tr><tr><td>events<\/td><td>Provides the ability to turn off default behaviour for some events<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4>Data<\/h4>\n\n\n\n<p>Each object in the <code>data<\/code> array describes a trace to be displayed on the chart. The properties available for the trace depend on what the <code>type<\/code> property is set to. Traces are categorised on the chart by trace type.<\/p>\n\n\n\n<p>The following is an example of the data property used to createa bar chart with two groups of data:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n  {\n    \"x\": &#91;\"giraffes\", \"orangutans\", \"monkeys\"],\n    \"y\": &#91;20, 14, 23],\n    \"name\": \"SF Zoo\",\n    \"type\": \"bar\"\n  },\n  {\n    \"x\": &#91;\"giraffes\", \"orangutans\", \"monkeys\"],\n    \"y\": &#91;12, 18, 29],\n    \"name\": \"LA Zoo\",\n    \"type\": \"bar\"\n  }\n]<\/code><\/pre>\n\n\n\n<h4>Layout<\/h4>\n\n\n\n<p>The layout property defines the attributes of the chart including things like the title, axes and annotations.<\/p>\n\n\n\n<p>The following is an example of the layout property being used for a waterfall chart:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"title\": {\n    \"text\": \"Profit and loss statement 2018\"\n  },\n  \"xaxis\": {\n    \"type\": \"category\"\n  },\n  \"yaxis\": {\n    \"type\": \"linear\"\n  },\n  \"showlegend\": true\n}<\/code><\/pre>\n\n\n\n<h4>Config<\/h4>\n\n\n\n<p>The config object is used for the configuration of certain properties on the chart.<\/p>\n\n\n\n<p>The following show some of the properties that can be set using the config property:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"displayModeBar\": true,\n  \"modeBarButtonsToRemove\": &#91;\"toImage\", \"select2d\"],\n  \"locale\": \"fr\",\n  \"displaylogo\": false\n}<\/code><\/pre>\n\n\n\n<h3>Event Handlers<\/h3>\n\n\n\n<p>A number of events are provided by the module that allow you to respond to various events such as clicking on the trace or making a selection on a trace.<\/p>\n\n\n\n<ul><li>onClick<\/li><li>onDoubleClick<\/li><li>onHover<\/li><li>onUnHover<\/li><li>onLegendClick<\/li><li>onLegendDoubleClick<\/li><li>onSelecting<\/li><li>onSelected<\/li><\/ul>\n\n\n\n<p>The default behaviour for the <code>onLegendClick<\/code> and <code>onLegendDoubleClick<\/code> events can be turned off using the properties inside the <code>event<\/code> property of the component.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Plotly Demo\" width=\"1024\" height=\"576\" src=\"https:\/\/www.youtube.com\/embed\/8cjs6OSVaBg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-gallery columns-3 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"566\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart-1024x566.png\" alt=\"\" data-id=\"391\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=391\" class=\"wp-image-391\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart-1024x566.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart-300x166.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart-768x425.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart-1536x850.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/waterfall-chart.png 1564w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Waterfall Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"573\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart-1024x573.png\" alt=\"\" data-id=\"390\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=390\" class=\"wp-image-390\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart-1024x573.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart-300x168.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart-768x430.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart-1536x859.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/sunburst-chart.png 1555w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Sunburst Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"572\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart-1024x572.png\" alt=\"\" data-id=\"389\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=389\" class=\"wp-image-389\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart-1024x572.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart-300x168.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart-768x429.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart-1536x858.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/ribbon-chart.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Ribbon Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"575\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart-1024x575.png\" alt=\"\" data-id=\"388\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=388\" class=\"wp-image-388\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart-1024x575.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart-300x168.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart-768x431.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart-1536x863.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/line-chart.png 1549w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Line Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"565\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart-1024x565.png\" alt=\"\" data-id=\"387\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=387\" class=\"wp-image-387\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart-1024x565.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart-300x166.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart-768x424.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart-1536x848.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/heatmap-chart.png 1564w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Heatmap Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"577\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart-1024x577.png\" alt=\"\" data-id=\"386\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=386\" class=\"wp-image-386\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart-1024x577.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart-300x169.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart-768x432.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart-1536x865.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/bar-chart.png 1547w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">Bar Chart<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"569\" src=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart-1024x569.png\" alt=\"\" data-id=\"385\" data-full-url=\"http:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart.png\" data-link=\"http:\/\/modules.bijc.co.uk\/?attachment_id=385\" class=\"wp-image-385\" srcset=\"https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart-1024x569.png 1024w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart-300x167.png 300w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart-768x427.png 768w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart-1536x854.png 1536w, https:\/\/modules.bijc.co.uk\/wp-content\/uploads\/2022\/04\/3D-surface-chart.png 1559w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"blocks-gallery-item__caption\">3D Surface Chart<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An implementation of the plotly.js library as a perspective component. 8.1 Module Download Link (Plotly v2.32.0) The 8.1 module is no longer being developed. This download is for legacy systems that require it. 8.3 Module Download Link (Plotly v3.0.8) A single component provides support for all plotly chart types through a flexible set of properties&#8230;. <a href=\"https:\/\/modules.bijc.co.uk\/?page_id=370\">read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/370"}],"collection":[{"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370"}],"version-history":[{"count":14,"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/370\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/370\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/modules.bijc.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}