Spaces:
Running
Running
os graficos devem ser gerados de forma automatica e eu so irei ajustar
Browse files453 unmodified lines454455456457458459460461462463464465466467468469470471472250 unmodified lines72372472572672772872973073134 unmodified lines7667677687697707717727737747759 unmodified lines78578678778878979079179279379479579679738 unmodified lines8368378388398408418428438448458462 unmodified lines849850851852853854855453 unmodified lines<div class="mb-6"><label for="chartType" class="block text-sm font-medium mb-1">Chart Type</label><select id="chartType" class="w-full px-4 py-2 border border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-dark-900 text-white"><option value="line">Line Chart</option><option value="bar">Bar Chart</option><option value="scatter">Scatter Plot</option><option value="pie">Pie Chart</option><option value="doughnut">Doughnut Chart</option><option value="radar">Radar Chart</option><option value="bubble">Bubble Chart</option><option value="boxplot">Box Plot</option><option value="heatmap">Heatmap</option><option value="area">Area Chart</option><option value="stackedBar">Stacked Bar</option><option value="stackedArea">Stacked Area</option><option value="combo">Combo Chart</option></select></div><div class="mb-6 grid grid-cols-1 md:grid-cols-3 gap-4">250 unmodified lines});// File input handlerdocument.getElementById('fileInput').addEventListener('change', handleFileUpload);// Column search functionalitydocument.getElementById('columnSearch').addEventListener('input', function(e) {const searchTerm = e.target.value.toLowerCase();const columnItems = document.querySelectorAll('#columnList .column-item');34 unmodified lines// PowerBI-like featuresdocument.getElementById('analyzeData').addEventListener('click', showDataInsights);// Generate chart buttondocument.getElementById('generateChart').addEventListener('click', generateChart);// Reset chart buttondocument.getElementById('resetChart').addEventListener('click', function() {if (currentChart) {currentChart.destroy();9 unmodified lines// Export chart buttondocument.getElementById('exportChartBtn').addEventListener('click', exportChart);// File upload handlerfunction handleFileUpload(e) {const file = e.target.files[0];if (!file) return;currentFile = file;document.getElementById('fileName').textContent = `Selected file: ${file.name}`;document.getElementById('fileSize').textContent = formatFileSize(file.size);38 unmodified linesconsole.error('Error processing file:', error);alert('Error processing file: ' + error.message);} finally {// Hide loading statechartLoading.style.display = 'none';}};reader.onerror = function() {alert('Error reading file');chartLoading.style.display = 'none';};2 unmodified lines// Analyze column types (date, number, text)function analyzeColumnTypes() {columnTypes = [];if (columns.length === 0 || rawData.length === 0) return;453 unmodified lines454455456457458459460461462463464465466467468469250 unmodified lines72072172272372472572672772872973073173273373473573673773834 unmodified lines7737747757767777787797807819 unmodified lines79179279379479579679779879980080180238 unmodified lines8418428438448458468478488498508518522 unmodified lines855856857858859860861862453 unmodified lines<div class="mb-6"><label for="chartType" class="block text-sm font-medium mb-1">Chart Type</label><select id="chartType" class="w-full px-4 py-2 border border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-dark-900 text-white"><option value="line">Line Chart (Auto)</option><option value="bar">Bar Chart</option><option value="scatter">Scatter Plot</option><option value="pie">Pie Chart</option><option value="doughnut">Doughnut Chart</option><option value="radar">Radar Chart</option><option value="bubble">Bubble Chart</option><option value="boxplot">Box Plot</option><option value="heatmap">Heatmap</option><option value="area">Area Chart</option></select></div><div class="mb-6 grid grid-cols-1 md:grid-cols-3 gap-4">250 unmodified lines});// File input handler// Auto generate charts when file is loadeddocument.getElementById('fileInput').addEventListener('change', function(e) {handleFileUpload(e).then(() => {// Auto select first two columns for X and Y axesif (columns.length >= 2) {addSelectedOption('xAxisSelect', columns[0], 0);addSelectedOption('yAxisSelect', columns[1], 1);generateChart();}});});=======// Column search functionalitydocument.getElementById('columnSearch').addEventListener('input', function(e) {const searchTerm = e.target.value.toLowerCase();const columnItems = document.querySelectorAll('#columnList .column-item');34 unmodified lines// PowerBI-like featuresdocument.getElementById('analyzeData').addEventListener('click', showDataInsights);// Generate chart button now shows "Update Chart"document.getElementById('generateChart').innerHTML = '<i class="fas fa-sync-alt mr-2"></i> Update Chart';// Reset chart buttondocument.getElementById('resetChart').addEventListener('click', function() {if (currentChart) {currentChart.destroy();9 unmodified lines// Export chart buttondocument.getElementById('exportChartBtn').addEventListener('click', exportChart);// File upload handler (now returns Promise)function handleFileUpload(e) {return new Promise((resolve, reject) => {const file = e.target.files[0];if (!file) return reject('No file selected');currentFile = file;document.getElementById('fileName').textContent = `Selected file: ${file.name}`;document.getElementById('fileSize').textContent = formatFileSize(file.size);38 unmodified linesconsole.error('Error processing file:', error);alert('Error processing file: ' + error.message);} finally {// Hide loading state and resolvechartLoading.style.display = 'none';resolve();}});reader.onerror = function() {alert('Error reading file');chartLoading.style.display = 'none';};2 unmodified lines// Analyze column types (date, number, text)function analyzeColumnTypes() {console.log('Analyzing column types for auto chart generation...');columnTypes = [];if (columns.length === 0 || rawData.length === 0) return;
index.html+37-30