lineChartWidgetSeries.tsx 905 B

1234567891011121314151617181920212223242526272829303132
  1. import LineSeries from 'sentry/components/charts/series/lineSeries';
  2. import type {TimeseriesData} from '../common/types';
  3. /**
  4. *
  5. * @param timeserie
  6. * @param complete Whether this series is fully ingested and processed data, or it's still behind the ingestion delay
  7. */
  8. export function LineChartWidgetSeries(timeserie: TimeseriesData, complete?: boolean) {
  9. return complete
  10. ? LineSeries({
  11. name: timeserie.field,
  12. color: timeserie.color,
  13. animation: false,
  14. data: timeserie.data.map(datum => {
  15. return [datum.timestamp, datum.value];
  16. }),
  17. })
  18. : LineSeries({
  19. name: timeserie.field,
  20. color: timeserie.color,
  21. animation: false,
  22. data: timeserie.data.map(datum => {
  23. return [datum.timestamp, datum.value];
  24. }),
  25. lineStyle: {
  26. type: 'dotted',
  27. },
  28. silent: true,
  29. });
  30. }