{"id":6396,"date":"2022-09-03T02:46:39","date_gmt":"2022-09-02T21:16:39","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/"},"modified":"2022-09-03T02:46:39","modified_gmt":"2022-09-02T21:16:39","slug":"solved-can-a-sed-graph-be-created-with-morris-js-closed","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/","title":{"rendered":"[Solved] Can a SED graph be created with morris.js? [closed]"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-24901768\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"24901768\" data-parentid=\"24840471\" data-score=\"4\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>That graph is a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/Spectral_energy_distribution\">SED or spectral energy distribution <\/a> graph or plot from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/ned.ipac.caltech.edu\/cgi-bin\/datasearch?objname=MRK1014&amp;meas_type=bot&amp;ebars_spec=ebars&amp;label_spec=no&amp;x_spec=freq&amp;y_spec=Fnu_jy&amp;xr=-1&amp;of=table&amp;search_type=Photometry\">NASA\/IPAC Extragalactic Database<\/a>. More information is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/coolwiki.ipac.caltech.edu\/index.php\/SED_plots\">here<\/a><br \/>\n.<\/p>\n<p>It has error bars displayed on the plot, but not point labels.<\/p>\n<p>Not all SED plots look like this one, so lets describe the features this one has <\/p>\n<ul>\n<li>Graph Title<\/li>\n<li>Scatterplot<\/li>\n<li>X axis label<\/li>\n<li>Y axis label<\/li>\n<li>X axis top scale<\/li>\n<li>X axis bottom scale<\/li>\n<li>X axis log scale<\/li>\n<li>Y axis log scale<\/li>\n<li>Error bars on points<\/li>\n<li>Custom glyphs for different points on scatterplot<\/li>\n<li>Point labels along x axis<\/li>\n<li>Y axis label with String and Date<\/li>\n<\/ul>\n<p>It could be recreated with morri.sjs, but it would take some effort to add all the missing functionality.<\/p>\n<p>Here is my basic attempt to use the existing functionality (not adding any functionality) of morris.js to plot some data from the above link. <\/p>\n<p><strong>HTML<\/strong><\/p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;script src=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/raphael\/2.1.0\/raphael-min.js\"&gt;&lt;\/script&gt;\n&lt;script src=\"http:\/\/code.jquery.com\/jquery-1.8.2.min.js\"&gt;&lt;\/script&gt;\n  &lt;script src=\"http:\/\/cdn.oesmith.co.uk\/morris-0.4.1.min.js\"&gt;&lt;\/script&gt;\n&lt;meta charset=utf-8 \/&gt;\n&lt;title&gt; Chart Example&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;p align=\"center\"&gt;MRK 1014&lt;\/p&gt;\n  &lt;div id=\"line-example\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt; \n<\/code><\/pre>\n<p><strong>JavaScript<\/strong><\/p>\n<pre><code>Morris.Line({\n  element: 'line-example',\n  data: [\n    { y: Math.log(1.45E+18), a: Math.log(6.41E-08) },\n    { y:  Math.log(1.45E+18), a: Math.log(1.03E-07)   },\n    { y:  Math.log(1.45E+18), a: Math.log(1.31E-07) },\n    { y:  Math.log(1.45E+18), a: Math.log(6.28E-08)  },\n    { y:  Math.log(1.45E+18), a: Math.log(8.55E-07)  },\n    { y:  Math.log(1.45E+18), a: Math.log(8.55E-07)  },\n    { y:  Math.log(1.45E+18), a: Math.log(5.59E-08) },\n    { y:  Math.log(1.45E+18), a: Math.log(6.55E-08)  }\n  ],\n  xkey: 'y',\n  ykeys: ['a', ],\n  labels: ['Series A'],\n  linewidth: 0,\n  pointSize: 2,\n  ymin : Math.log(1E-08),\n  ymax : Math.log(1E3),\n\n});\n<\/code><\/pre>\n<p>As you can see it looks nothing like the picture you posted.<\/p>\n<p>Going through the list feature by feature,<\/p>\n<p>Graph Title doesn&#8217;t have to be a piece of morris.js functionality, it can be a regular html heading or paragraph element. <\/p>\n<p>X axis label and Y axis label also aren&#8217;t supported by morris.js , buy you can do them with HTML paragraph elements and CSS3 writing-mode property or transform function as documented <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.thecssninja.com\/css\/real-text-rotation-with-css\">here<\/a> for the Y label. Y axis label with the date and string can be done same way.<\/p>\n<p>You can manually place the conversions on the top scale or you could add support for a top scale and conversion support.<\/p>\n<p>For log scale support, you would need to modify <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/morrisjs\/morris.js\/blob\/master\/lib\/morris.grid.coffee\">morris.grid.coffee<\/a> and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/morrisjs\/morris.js\/blob\/master\/lib\/morris.line.coffee\">morris.line.coffe<\/a>.<\/p>\n<p>Same with custom glyph and error bar support and the categorical labels along the x axis.<\/p>\n<p>Based on the amount of work, and the morris.js is a project for Pretty time-series line graphs, and your graph is neither a line graph, nor a time series line graph. I think you be better suited to use d3.js or Google Charts or some other JavaScript graphing library.<\/p>\n<p>d3.js scatterplot examples include <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/bl.ocks.org\/mbostock\/3887118\">here<\/a> and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/nvd3.org\/examples\/scatter.html\">here<\/a>. Also checkout <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.usvao.org\/science-tools-services\/iris-sed-analysis-tool\/\">Iris SED Analysis Tool<\/a> which draws SEDs and has NED direct import support.<\/p>\n<p>These options already have graph title support, scatterplot support, x and y axis label support and log scale support and custom glyph for points, and the other things can be added easier than by writing extensions to morris.js.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\"><\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Can a SED graph be created with morris.js? [closed] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] That graph is a SED or spectral energy distribution graph or plot from NASA\/IPAC Extragalactic Database. More information is here . It has error bars displayed on the plot, but not point labels. Not all SED plots look like this one, so lets describe the features this one has Graph Title Scatterplot X axis &#8230; <a title=\"[Solved] Can a SED graph be created with morris.js? [closed]\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\" aria-label=\"More on [Solved] Can a SED graph be created with morris.js? [closed]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[771,1757],"class_list":["post-6396","post","type-post","status-publish","format-standard","hentry","category-solved","tag-graph","tag-morris-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] That graph is a SED or spectral energy distribution graph or plot from NASA\/IPAC Extragalactic Database. More information is here . It has error bars displayed on the plot, but not point labels. Not all SED plots look like this one, so lets describe the features this one has Graph Title Scatterplot X axis ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-02T21:16:39+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Can a SED graph be created with morris.js? [closed]\",\"datePublished\":\"2022-09-02T21:16:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\"},\"wordCount\":426,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"graph\",\"morris.js\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\",\"name\":\"[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-09-02T21:16:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Can a SED graph be created with morris.js? [closed]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb","og_description":"[ad_1] That graph is a SED or spectral energy distribution graph or plot from NASA\/IPAC Extragalactic Database. More information is here . It has error bars displayed on the plot, but not point labels. Not all SED plots look like this one, so lets describe the features this one has Graph Title Scatterplot X axis ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/","og_site_name":"JassWeb","article_published_time":"2022-09-02T21:16:39+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Can a SED graph be created with morris.js? [closed]","datePublished":"2022-09-02T21:16:39+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/"},"wordCount":426,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["graph","morris.js"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/","url":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/","name":"[Solved] Can a SED graph be created with morris.js? [closed] - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-02T21:16:39+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-can-a-sed-graph-be-created-with-morris-js-closed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Can a SED graph be created with morris.js? [closed]"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/6396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=6396"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/6396\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=6396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=6396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=6396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}