fix: Track the chart type correctly (#2773)
This commit is contained in:
parent
4e1caf2417
commit
49e792649d
@ -1,4 +1,3 @@
|
|||||||
import { trackEvent } from "./analytics";
|
|
||||||
import colors from "./colors";
|
import colors from "./colors";
|
||||||
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, ENV } from "./constants";
|
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, ENV } from "./constants";
|
||||||
import { newElement, newLinearElement, newTextElement } from "./element";
|
import { newElement, newLinearElement, newTextElement } from "./element";
|
||||||
@ -473,7 +472,6 @@ export const renderSpreadsheet = (
|
|||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
): ChartElements => {
|
): ChartElements => {
|
||||||
trackEvent("magic", "chart", chartType, spreadsheet.values.length);
|
|
||||||
if (chartType === "line") {
|
if (chartType === "line") {
|
||||||
return chartTypeLine(spreadsheet, x, y);
|
return chartTypeLine(spreadsheet, x, y);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import oc from "open-color";
|
import oc from "open-color";
|
||||||
import React, { useLayoutEffect, useRef, useState } from "react";
|
import React, { useLayoutEffect, useRef, useState } from "react";
|
||||||
|
import { trackEvent } from "../analytics";
|
||||||
import { ChartElements, renderSpreadsheet, Spreadsheet } from "../charts";
|
import { ChartElements, renderSpreadsheet, Spreadsheet } from "../charts";
|
||||||
import { ChartType } from "../element/types";
|
import { ChartType } from "../element/types";
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
@ -86,6 +87,7 @@ export const PasteChartDialog = ({
|
|||||||
|
|
||||||
const handleChartClick = (chartType: ChartType, elements: ChartElements) => {
|
const handleChartClick = (chartType: ChartType, elements: ChartElements) => {
|
||||||
onInsertChart(elements);
|
onInsertChart(elements);
|
||||||
|
trackEvent("magic", "chart", chartType);
|
||||||
setAppState({
|
setAppState({
|
||||||
currentChartType: chartType,
|
currentChartType: chartType,
|
||||||
pasteDialog: {
|
pasteDialog: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user