diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 8ac8a4b93e..3675c6cadf 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -1847,6 +1847,20 @@ function tooltip_format() { }); } +function tooltip_order() { + const chart = c3.generate({ + data: { + columns: [ + ["data1", 30, 200, 100, 400, 150, 250], + ["data2", 50, 20, 10, 40, 15, 25] + ] + }, + tooltip: { + order: 'asc' + } + }); +} + //////////////////////// // Chart options Tests //////////////////////// diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 322adce77d..1b0adce9a1 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -737,6 +737,10 @@ export interface TooltipOptions { * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. */ contents?(data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any): string; + /** + * Set tooltip values order + */ + order?: string | any[] | ((data: Data) => boolean); } export interface SubchartOptions {