
        }
        const colors = generatePalette(values.length, state.palette, state.baseColor);
        data.labels = usedLabels;
        data.datasets.push({
          label: state.headers[col] || `Column ${col+1}`,
          data: values,
          backgroundColor: colors,
          borderWidth: 1,
          borderColor: colors.map(c => alpha(c, 0.9)),
          hoverOffset: 4,
        });
      } else {
        for (const col of state.datasets) {
          const color = state.datasetColors[col] || '#6b