Skip to content

Cannot Draw Grouped Bars (Plugin) #1079

Description

@riccardostokker

Hello,

Thanks for the amazing library. I've been using it for time series and it's a blast. Now I've moved on to grouped bar plots and I'm having some trouble.

I'm trying to use the groupedBarsPlugin as shown in the demos, but I am having some trouble as can be seen in the image below.

I have copied over and adapted the code from the examples online. I tried to migrate it to TypeScript to make it compatible with my project. These results are reported below.

I have a couple questions related to the code:

  • Would it be possible to include these plugins inside the npm package so that we could use them in a plug and play fashion?
  • Is there any obvious reason that the bars are not gettign drawn in my plot?
Image

Plot Opts and Instantiation

    // Define Plot Options
    const opts = {
      title: undefined,
      id: props.specification.metadata.uuid || "time-series-plot",
      class: props.specification.metadata.uuid || "grouped-bar-series-plot",
      width: 0,
      height: 0,
      series: series,
      axes: axes,
      plugins: [
        seriesBarsPlugin({
          radius: 0.3,
          ori: 0,
          dir: 1,
        }),
      ],
    };

    // Create new plot instance
    plotInstance.value = new uPlot(opts, data, plotRef.value);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions