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

Selection issues with line points #3034

Open
eamodio opened this issue Jan 12, 2023 · 1 comment
Open

Selection issues with line points #3034

eamodio opened this issue Jan 12, 2023 · 1 comment
Labels

Comments

@eamodio
Copy link

eamodio commented Jan 12, 2023

I'm still having a few issues with selection and line points.

  1. Using selection.multiple = false seems to only work for a single "data set", e.g. "data1" or "data2" below.
var chart = bb.generate({
  data: {
    columns: [
	["data1", 30, 200, 100, 400, 150, 250],
	["data2", 230, 280, 320, 218, 250, 150]
    ],
    type: "line", // for ESM specify as: line()
    selection: {
      enabled: true, // for ESM specify as: selection()
      grouped: true,
      multiple: false,
      draggable: false
    }
  },
  bindto: "#dataSelection"
});
  1. Using point.focus.only = true doesn't seem to allow selection of data point via user input (clicking)
var chart = bb.generate({
  data: {
    columns: [
	["data1", 30, 200, 100, 400, 150, 250],
    ],
    type: "line", // for ESM specify as: line()
    selection: {
      enabled: true, // for ESM specify as: selection()
      grouped: true,
      multiple: false,
      draggable: false
    }
  },
  point: {
    focus: {
      only: true,
    },
  },
  bindto: "#dataSelection"
});
  1. Using chart.select doesn't seem to work if point.focus.only = true
var chart = bb.generate({
  data: {
    columns: [
	["data1", 30, 200, 100, 400, 150, 250],
    ],
    type: "line", // for ESM specify as: line()
    selection: {
      enabled: true, // for ESM specify as: selection()
      grouped: true,
      multiple: false,
      draggable: false
    }
  },
  point: {
    focus: {
      only: true,
    },
  },
  bindto: "#dataSelection"
});

setInterval(() => {
  chart.select(["data1"], [Math.floor(Math.random() * 5)], true);
}, 2000);

Thanks for any help or guidance.

@netil
Copy link
Member

netil commented Jan 13, 2023

It'll take time to fix the issue. point.focus.only option has been added after the selection feature implementation.

The selection will work based on the data point's element position, but when point.focus.only option is enabled, it will generate only one data point element, which can't get each data points position based on that anymore.

@netil netil added the bug label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants