{"id":53262,"date":"2024-12-03T11:05:22","date_gmt":"2024-12-03T03:05:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53262\/"},"modified":"2024-12-03T11:05:22","modified_gmt":"2024-12-03T03:05:22","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-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53262\/","title":{"rendered":"Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f<\/h1>\n<p>\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u6211\u4eec\u8981\u52aa\u529b\u5b66\u4e60\u5566\uff01\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aEcharts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u300b<\/span>\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427\uff01\u4e0b\u6587\u4e2d\u7684\u5185\u5bb9\u6211\u4eec\u4e3b\u8981\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5728\u9605\u8bfb\u672c\u6587\u8fc7\u7a0b\u4e2d\u6709\u9047\u5230\u4e0d\u6e05\u695a\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u7559\u8a00\u5440\uff01\u6211\u4eec\u4e00\u8d77\u8ba8\u8bba\uff0c\u4e00\u8d77\u5b66\u4e60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241128\/173278299367482b91d6c83.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>\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>\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>\u4eca\u5929\u5173\u4e8e\u300aEcharts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u7c73\u4e91\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u5728HTML\u4e2d\u6b63\u786e\u663e\u793a\u53cd\u659c\u6760\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Echarts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f \u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u6211\u4eec\u8981\u52aa\u529b\u5b66\u4e60\u5566\uff01\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u300aEcharts \u53cc\u8f74\u5982\u4f55\u540c\u65f6\u663e\u793a\u6807\u7b7e\uff1f\u300b\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427\uff01\u4e0b\u6587\u4e2d\u7684\u5185\u5bb9\u6211\u4eec\u4e3b\u8981\u4f1a\u6d89\u53ca\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5728\u9605\u8bfb\u672c\u6587\u8fc7\u7a0b\u4e2d\u6709\u9047\u5230\u4e0d\u6e05\u695a\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u7559\u8a00\u5440\uff01\u6211\u4eec\u4e00\u8d77\u8ba8\u8bba\uff0c\u4e00\u8d77\u5b66\u4e60\uff01 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;; }, }, }, [&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-53262","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53262","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=53262"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53262\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}