making the chart responsive
This commit is contained in:
		@ -1,6 +1,5 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref } from "vue";
 | 
			
		||||
import {w} from "../../dist/assets/_plugin-vue_export-helper-Bvj9NrzX.js";
 | 
			
		||||
const input = ref("");
 | 
			
		||||
const statsOf = ref("");
 | 
			
		||||
const statsBy = ref("");
 | 
			
		||||
@ -61,11 +60,15 @@ const mydata = {
 | 
			
		||||
  },
 | 
			
		||||
  methods : {
 | 
			
		||||
    chartInstance(chart){
 | 
			
		||||
      console.log(chart)
 | 
			
		||||
      this.chart = chart;
 | 
			
		||||
      mydata.chart = chart
 | 
			
		||||
    },
 | 
			
		||||
    update(){
 | 
			
		||||
      this.chart.render();
 | 
			
		||||
      mydata.options.title = {
 | 
			
		||||
        fontColor: "white",
 | 
			
		||||
        text: statsOf.value + " By "+ statsBy.value,
 | 
			
		||||
      }
 | 
			
		||||
      mydata.chart.render()
 | 
			
		||||
      console.log(mydata.options.title)
 | 
			
		||||
      setTimeout(this.update, 1000);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@ -108,7 +111,7 @@ const mydata = {
 | 
			
		||||
        </select>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div id="statsPie">
 | 
			
		||||
        <CanvasJSChart :options="mydata.options" :style="mydata.styleOptions" @chart-ref="mydata.methods.chartInstance(this)"/>
 | 
			
		||||
        <CanvasJSChart :options="mydata.options" :style="mydata.styleOptions"  @chart-ref="mydata.methods.chartInstance"/>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div id="articles">
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user