Browse Source

fixed setting btn

andy 4 months ago
parent
commit
367438457e
1 changed files with 10 additions and 2 deletions
  1. 10 2
      js/demo/text-to-chart.js

+ 10 - 2
js/demo/text-to-chart.js

@@ -1061,7 +1061,7 @@ chartTypeBtn.addEventListener('change', function () {
             labels = [];
             myChart.destroy();
         }
-
+        sidebar.classList.add('hidden');
         generateChart(dataArray);
 
     } else if (selectedValue === 'bar') {
@@ -1070,7 +1070,7 @@ chartTypeBtn.addEventListener('change', function () {
         $('#textToChart').hide();
         // 处理柱状图
         console.log('處理柱狀圖', dataArray);
-
+        sidebar.classList.add('hidden');
         extractAndGenerateChart(dataArray);
     } else if (selectedValue === 'doughnut') {
         chartType = 'doughnut';
@@ -1078,6 +1078,7 @@ chartTypeBtn.addEventListener('change', function () {
         console.log('處理圓餅圖', dataArray);
         unit_value.textContent = "";
         $('#textToChart').hide();
+        sidebar.classList.add('hidden');
 
         generatePieChart(dataArray, pieFontSize, PieMaxWidth)
         // 处理圆饼图
@@ -1489,6 +1490,13 @@ function createChart(chartType, data, labels) {
         pointHoverRadiusValue = 8;
 
         togglePoints.checked = true;
+        toggleValue.checked = true;
+
+
+    } else {
+        togglePoints.checked = false;
+
+        toggleValue.checked = false;
     }