l_gauge_chart_vue.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8" />
  8. <title data-i18n="resources.title_componentsChart_Vue(gauge)"></title>
  9. <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
  10. <script include="echarts-vue,iclient-leaflet-vue" src="../../dist/leaflet/include-leaflet.js"></script>
  11. <style>
  12. #main {
  13. margin: 0 auto;
  14. width: 100%;
  15. height: 100%;
  16. }
  17. .sm-component-chart .sm-component-collapse-card__content {
  18. height: 300px;
  19. }
  20. </style>
  21. </head>
  22. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  23. <div id="main">
  24. <sm-web-map server-url='https://iportal.supermap.io/iportal' map-id="801571284"> </sm-web-map>
  25. <sm-chart icon-class="" :style="chartStyle" :dataset="dataset" :dataset-options="datasetOptions"></sm-chart>
  26. </div>
  27. <script>
  28. new Vue({
  29. el: "#main",
  30. data() {
  31. return {
  32. chartStyle: {
  33. position: "absolute",
  34. bottom: "10px",
  35. right: "10px",
  36. zIndex: 500
  37. },
  38. dataset: new SuperMap.Components.commontypes.RestDataParameter({
  39. url: "https://iserver.supermap.io/iserver/services/data-jingjin/rest/data",
  40. dataName: ["Jingjin:Landuse_R"],
  41. maxFeatures: 20,
  42. attributeFilter: "SmID = 2"
  43. }),
  44. datasetOptions: [
  45. {
  46. seriesType: "gauge", //图表类型
  47. isStastic: true, //是否统计, 默认不统计
  48. xField: "LANDTYPE", //x坐标轴数据字段
  49. yField: "AREA" //统计的数据,legned默认名字
  50. }
  51. ]
  52. };
  53. }
  54. });
  55. </script>
  56. </body>
  57. </html>