What format is the data given in before it is graphed?

I’m making an add on and want to use to _graph() function in anki.stats . However I’m unsure + struggling to find out the exact format it is given in?

The function _splitRepData also seems to do something to it before it is actually graphed. Would someone be able to explain both formats / before after.

By format i mean like a 2 dimensional array or however it is. The one I’m looking at is ‘introductionGraph’ so the axis are cards added + time, however i assume data is given in the same format everywhere?


To know the format of the data, you can just open the function definition and print its parameters:

    def _graph(
        id: str,
        data: Any,
        conf: Optional[Any] = None,
        type: str = "bars",
        xunit: int = 1,
        ylabel: str = _("Cards"),
        ylabel2: str = "",
    ) -> str:
        print(f"_graph self '{self}' id '{id}' data '{data}' conf '{conf}' type '{type}' xunit '{xunit}' ylabel '{ylabel}' ylabel2 '{ylabel2}'.")
        if conf is None:
            conf = {}

Then, open anki and make it generate some graphs and observe the format of the data being passed to the function when they are printed to the console.