Question

Setting a custom event for X axis on Line Chart

  • 21 December 2020
  • 1 reply
  • 43 views

I am sending some custom events to MixPanel via `mixpanel-js`. The events look like this:

{keyA: 1, keyB: 2, keyC: 3, customDate: ‘2020-02-01T00:00:00’}
{keyA: 3, keyB: 4, keyC: 1, customDate: ‘2020-03-01T00:00:00’}

{keyA: 5, keyB: 1, keyC: 4, customDate: ‘2020-04-01T00:00:00’}


I would like to plot these in MixPanel’s Insights view using a line chart where the X axis is my “customDate” field, and not the date when the event was submitted.

The question I’m trying to answer is: “How do values of keyA, keyB and keyC change over time (where the time is the customDate value)?”

I can’t seem to find any way to configure what field I want to use for the X axis. It seems to be hardcoded to always use the date of the event submission. Is there any way for me to change this?


1 reply

Userlevel 6
Badge +3

@EvHaus —

You’ll want to use our import API instead of JS in order to sent old events to Mixpanel. With our import API you can set the time property to something in the past.

https://help.mixpanel.com/hc/en-us/articles/115004734463-Importing-Data#sending-old-events-without-cloud-import

 

Otherwise, as you can see from your testing, the time will be recorded as when the event was sent.

Reply


Mixpanel