thinger-io / thinger-server

Thinger.io Server Repository
MIT License
2 stars 0 forks source link

[Dashboard] - CSV is not exported correctly by Apex Charts Widget #80

Open georgevbsantiago opened 8 months ago

georgevbsantiago commented 8 months ago

When exporting data from the Apex Charts Widget, the hour, minute and second corresponding to the exported data are not informed.

CSV (Timestamp records do not inform the hour, minute and second): image

Widget Apex Chart: image

We tried changing the Apex Charts configuration, but nothing works correctly.

Apex Charts documentation:

var options = {
    series: series,
    chart: {
        type: 'line',
        zoom: {
            enabled: true
        }
    },
    zoom: {
        type: 'x',
        enabled: true,
        autoScaleYaxis: true
    },
    toolbar: {
 export: {
          csv: {
            filename: 'name_teste',
            columnDelimiter: ';',
            headerCategory: 'data_hora',
            headerValue: 'value',
            dateFormatter(timestamp) {
              return new Date(timestamp).toDateString()
            }
          },
        }
    },
    stroke: {
        curve: 'straight',
        width: 4
    },
    grid: {
        row: {
            colors: ['#f3f3f3', 'transparent'],
            opacity: 0.5
        },
    },
    xaxis: {
        type: 'datetime',
        tooltip: {
            enabled: false
        },
        labels: {
            datetimeUTC: false
        }
    },
    yaxis: {
        labels: {
            "formatter": function (val) {
                return val;
            }
        }
    },
    tooltip: {
        x: {
            format: 'dd/MM/yyyy HH:mm:ss'
        }
    }
};

Is it possible to change the Apex Charts export (CSV) configuration, or is there a lock?