<template>
  <div class="preview-chart">
    <van-sticky>
      <nav-bar
        :title="chartName"
        :is-custom="true"
        @go-back="handleGoBack"
      ></nav-bar>
    </van-sticky>
    <ht-chart
      :id="chartId"
      :chart-key="chartId"
      :isMoreUrl="true"
      :name="chartName"
    ></ht-chart>
  </div>
</template>

<script>
  export default {
    name: 'previewChart',
    data() {
      return {}
    },
    computed: {
      chartName() {
        return this.$route.query.name
      },
      chartId() {
        return this.$route.query.chartId
      },
    },
    methods: {
      handleGoBack() {
        this.$router.go(-1)
      },
    },
  }
</script>

<style lang="scss" scoped>
  .preview-chart {
    background-color: #fff;
    height: $vh;
  }
</style>
