Skip to content

Multiple values in same graph #36

@afonsoc12

Description

@afonsoc12

Hello,
First of all, many thanks for this plugin. It has been working flawlessly for several JSON API's that I have already tested with.

However, there is this time-series API which I do not know how to plot multiple time-series in the same plot. This data comes from FireflyIII.

[
    {
        "label": "account 1",
        "currency_id": 3,
        "currency_code": "GBP",
        "currency_symbol": "£",
        "currency_decimal_places": 2,
        "start_date": "2020-12-01",
        "end_date": "2020-12-31",
        "type": "line",
        "yAxisID": 0,
        "entries": {
            "2020-12-01": 1,
            "2020-12-02": 2,
            "2020-12-03": 3,
            "2020-12-04": 4,
            "2020-12-05": 5,
            "2020-12-06": 6,
            "2020-12-07": 7,
            "2020-12-08": 8,
            "2020-12-09": 9,
            "2020-12-10": 10,
            "2020-12-11": 11,
            "2020-12-12": 12,
            "2020-12-13": 13,
            "2020-12-14": 14,
            "2020-12-15": 15,
            "2020-12-16": 16,
            "2020-12-17": 17,
            "2020-12-18": 18,
            "2020-12-19": 19,
            "2020-12-20": 20,
            "2020-12-21": 21,
            "2020-12-22": 22,
            "2020-12-23": 23,
            "2020-12-24": 24,
            "2020-12-25": 25,
            "2020-12-26": 26,
            "2020-12-27": 27,
            "2020-12-28": 28,
            "2020-12-29": 29,
            "2020-12-30": 30,
            "2020-12-31": 31
        }
    },
    {
        "label": "account 2",
        "currency_id": 3,
        "currency_code": "GBP",
        "currency_symbol": "£",
        "currency_decimal_places": 2,
        "start_date": "2020-12-01",
        "end_date": "2020-12-31",
        "type": "line",
        "yAxisID": 0,
        "entries": {
            "2020-12-01": 31,
            "2020-12-02": 30,
            "2020-12-03": 29,
            "2020-12-04": 28,
            "2020-12-05": 27,
            "2020-12-06": 26,
            "2020-12-07": 25,
            "2020-12-08": 24,
            "2020-12-09": 23,
            "2020-12-10": 20,
            "2020-12-11": 21,
            "2020-12-12": 20,
            "2020-12-13": 19,
            "2020-12-14": 18,
            "2020-12-15": 17,
            "2020-12-16": 16,
            "2020-12-17": 15,
            "2020-12-18": 14,
            "2020-12-19": 13,
            "2020-12-20": 12,
            "2020-12-21": 11,
            "2020-12-22": 10,
            "2020-12-23": 9,
            "2020-12-24": 8,
            "2020-12-25": 7,
            "2020-12-26": 6,
            "2020-12-27": 5,
            "2020-12-28": 4,
            "2020-12-29": 3,
            "2020-12-30": 2,
            "2020-12-31": 1
        }
    }
]

I have a Grafana Variable which is called asset_accounts which maps to the json label, such as account 1 and account 2

On the query field I have experimented with: $.[?(@.label =~"${asset_accounts}")].entries[*] but it just concatenates the points and does not put them into "another column".
Also, to have the time-stamps I have to use the queries: $.[?(@.label =~"${asset_accounts}")].entries[*~] (keys) and $.[?(@.label =~"${asset_accounts}")].entries[*], since $.[?(@.label =~"${asset_accounts}")].entries[*~, *] generates two grafana data-frames.

Any thoughts? Is this possible to achieve at all?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions