Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work with multiple series in a single dataframe #265

Open
Gauravshah opened this issue Jan 29, 2021 · 0 comments
Open

doesn't work with multiple series in a single dataframe #265

Gauravshah opened this issue Jan 29, 2021 · 0 comments

Comments

@Gauravshah
Copy link

If a datasource returns multiple series in a single dataframe then the pie chart remains blank.

tried with new datasource.
following works:

    const data = options.targets.map(target => {
      const query = defaults(target, defaultQuery);
      return new MutableDataFrame({
        refId: query.refId,
        fields: [
          { name: 'Time', values: [from, to], type: FieldType.time },
          { name: 'Value', values: [query.constant, query.constant], type: FieldType.number }
        ],
      });
    });

and following fails:

    const data = options.targets.map(target => {
      const query = defaults(target, defaultQuery);
      return new MutableDataFrame({
        refId: query.refId,
        fields: [
          { name: 'Time', values: [from, to], type: FieldType.time },
          { name: 'Value', values: [query.constant, query.constant], type: FieldType.number },
          { name: 'Value2', values: [query.constant * 2, query.constant * 1.5], type: FieldType.number },
        ],
      });
    });

Steps to reproduce:
either create a brand new datasource and update the code as above
or try using the TestDB datasource with random walk table.

Screenshots
Table using single dataframe multiple columns:
Screenshot 2021-01-29 at 12 08 57 PM

Graph using single dataframe multiple columns:
Screenshot 2021-01-29 at 12 09 09 PM

Pie chart using single dataframe multiple columns:
Screenshot 2021-01-29 at 12 09 17 PM

Similar example for Test db source
table:
Screenshot 2021-01-29 at 12 35 27 PM

graph
Screenshot 2021-01-29 at 12 35 21 PM

piechart
Screenshot 2021-01-29 at 12 35 33 PM

Console looks like this:
Screenshot 2021-01-29 at 12 35 50 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant