{"id":1583,"date":"2024-11-10T15:30:23","date_gmt":"2024-11-10T07:30:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1583\/"},"modified":"2024-11-10T15:30:23","modified_gmt":"2024-11-10T07:30:23","slug":"echarts-%e5%8f%8c%e8%bd%b4%e5%a6%82%e4%bd%95%e5%90%8c%e6%97%b6%e6%98%be%e7%a4%ba%e6%a0%87%e7%ad%be%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1583\/","title":{"rendered":"Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173050714833076.jpg\" class=\"aligncenter\" title=\"Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u63d2\u56fe\" alt=\"Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>echarts \u53cc\u8f74\u5747\u663e\u793a\u6807\u7b7e<\/strong><\/p>\n<p>\u5728 echarts \u56fe\u8868\u4e2d\uff0c\u53cc\u8f74\u662f\u5e38\u89c1\u9700\u6c42\u3002\u6709\u65f6\u9700\u8981\u5728\u4e0a\u65b9\u8f74\u548c\u4e0b\u65b9\u8f74\u90fd\u663e\u793a\u6807\u7b7e\u3002\u7136\u800c\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u4e0b\u65b9\u8f74\u663e\u793a\u6807\u7b7e\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4e3a\u53cc\u8f74\u90fd\u663e\u793a\u6807\u7b7e\u3002<\/p>\n<pre>xaxis: [\n  {\n    min: starttime,\n    scale: true,\n\n    axislabel: {\n      formatter: function (val) {\n        return math.max(0, val - starttime) + \" ms\";\n      },\n    },\n  },\n  {\n    min: starttime,\n    scale: true,\n\n    axislabel: {\n      formatter: function (val) {\n        return math.max(0, val - starttime) + \" ms\";\n      },\n    },\n  },\n],<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5982\u4e0a\u6240\u793a\uff0c\u901a\u8fc7\u8bbe\u7f6e\u4e24\u4e2a x \u8f74\uff0c\u53ef\u4ee5\u5b9e\u73b0\u53cc\u8f74\u3002\u6bcf\u4e2a x \u8f74\u5177\u6709\u76f8\u540c\u7684\u6807\u7b7e\u683c\u5f0f\u5316\u5668\uff0c\u786e\u4fdd\u4e24\u4e2a\u8f74\u7684\u6807\u7b7e\u4e00\u81f4\u3002<\/p>\n<p>\u5b8c\u6574\u4ee3\u7801\u8303\u4f8b\uff1a<\/p>\n<pre>option = {\n  xaxis: [\n    {\n      type: 'category',\n      data: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']\n    },\n    {\n      type: 'category',\n      data: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']\n    }\n  ],\n  yaxis: [\n    {\n      type: 'value',\n      inverse: true\n    },\n    {\n      type: 'value'\n    }\n  ],\n  series: [\n    {\n      data: [120, 120, 10, 80, 70, 70, 130],\n      type: 'bar',\n    },\n    {\n      data: [10, 20, 110, 50, 30, 20, 80],\n      type: 'bar',\n      xaxisindex: 1,\n      yaxisindex: 1\n    }\n  ]\n};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p>[\u56fe\u7247\uff1a\u53cc\u8f74\u6807\u7b7e]<\/p>\n<p>\u8981\u4ec5\u5728\u4e0a\u65b9\u8f74\u663e\u793a\u65e5\u671f\u6807\u7b7e\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6807\u7b7e\u683c\u5f0f\u5316\u5668\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>axisLabel: {\n  formatter: function (val) {\n    if (val &gt;= startTime) {\n      return Math.max(0, val - startTime) + \" ms\";\n    }\n  },\n},<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fEcharts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>echarts \u53cc\u8f74\u5747\u663e\u793a\u6807\u7b7e \u5728 echarts \u56fe\u8868\u4e2d\uff0c\u53cc\u8f74\u662f\u5e38\u89c1\u9700\u6c42\u3002\u6709\u65f6\u9700\u8981\u5728\u4e0a\u65b9\u8f74\u548c\u4e0b\u65b9\u8f74\u90fd\u663e\u793a\u6807\u7b7e\u3002\u7136\u800c\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u4e0b\u65b9\u8f74\u663e\u793a\u6807\u7b7e\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4e3a\u53cc\u8f74\u90fd\u663e\u793a\u6807\u7b7e\u3002 xaxis: [ { min: starttime, scale: true, axislabel: { formatter: function (val) { return math.max(0, val &#8211; starttime) + &#8221; ms&#8221;; }, }, }, { min: starttime, scale: true, axislabel: { formatter: function (val) { return math.max(0, val &#8211; starttime) + &#8221; ms&#8221;; }, }, }, ], \u767b\u5f55\u540e\u590d\u5236 \u5982\u4e0a\u6240\u793a\uff0c\u901a\u8fc7\u8bbe\u7f6e\u4e24\u4e2a x [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1583","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1583"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1583\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}