Type alias ThemePropertyWithCallbackOption<T>

ThemePropertyWithCallbackOption<T>: T | Palette<T>

Type definition for property of Theme that can either be a hard defined value, or a callback function which provides a different value based on how many times it is requested.

Can be used for example to set different color for 2nd series, 3rd series, etc.

 // Example, hard defined value
lineSeriesStrokeStyle: new SolidLine({ thickness: 2, fillStyle: ColorRGBA(255, 0, 0) })
 // Example, different color for each series
lineSeriesStrokeStyle: (index) => new SolidLine({ thickness: 2, fillStyle: ColorHSV(index * 90) })

Type Parameters

  • T