Browse Source

update x ticks display none

andy 3 months ago
parent
commit
2253795b1a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      js/demo/text-to-chart.js

+ 5 - 1
js/demo/text-to-chart.js

@@ -1511,6 +1511,8 @@ function getDatalabelsConfig(isEnabled) {
 // // 创建 Chart.js 图表
 function createChart(chartType, data, labels) {
 
+    compare_type_input.style.display = 'block'
+
     $('#textToChart').show();
     canvasPng.style.maxWidth = '';
     canvasPng.style.maxHeight = '';
@@ -1881,7 +1883,9 @@ const toggleXAxis = document.getElementById('toggleXAxis');
 
 toggleXAxis.addEventListener('change', function () {
     // 根据复选框的状态来显示或隐藏 X 轴
-    myChart.options.scales.x.ticks.display = this.checked;
+    myChart.options.scales.x.ticks.color = this.checked ? 'rgba(88,75,61,1)' : 'rgba(88,75,61,0)';
+    myChart.options.scales.x.ticks.textStrokeColor = this.checked ? 'rgba(255, 255, 255, 1)' : 'rgba(255, 255, 255, 0)';
+
 
     // 更新图表
     myChart.update();