components_gauge_chart_vue.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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-mapboxgl-vue,mapbox-gl-enhance" src="../../dist/mapboxgl/include-mapboxgl.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. },
  37. dataset: new SuperMap.Components.commontypes.RestDataParameter({
  38. url: "https://iserver.supermap.io/iserver/services/data-jingjin/rest/data",
  39. dataName: ["Jingjin:Landuse_R"],
  40. maxFeatures: 20,
  41. attributeFilter: "SmID = 2"
  42. }),
  43. datasetOptions: [
  44. {
  45. seriesType: "gauge", //图表类型
  46. isStastic: true, //是否统计, 默认不统计
  47. xField: "LANDTYPE", //x坐标轴数据字段
  48. yField: "AREA" //统计的数据,legned默认名字
  49. }
  50. ]
  51. };
  52. }
  53. });
  54. </script>
  55. </body>
  56. </html>