Skip to content

Change plotted color for each point in the dataset #485

Open
@mihaly-sisak

Description

Hi!

I would like to implement a feature to change the plotted color for each point in the dataset, something like this.

I plan on doing it this way:

  • Defining a ColorGetter struct with function: ImU32 operator()(ImPlotCol col, int idx), this will be the base case, constant colors from ImPlotNextItemData
  • Defining a ColorGetterFuncPtr struct where an user defined function is passed in and called, GetterFuncPtr style
  • Renderer* structs will take a templated ColorGetter as an argument instead of ImU32 col
  • User facing functions will use ColorGetter, but a new version of them will use ColorGetterFuncPtr

Is this the way of doing this? Will this get merged if I implement it?

Metadata

Assignees

No one assigned

    Labels

    plot typeRequesting a plot type that isn't supported yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions