mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
c3: add missing fields in LegendOptions
There is configuration for tiles introduced with https://github.com/c3js/c3/issues/1033 and defined in spec/legend-spec.js which is missing from @types/c3.
This commit is contained in:
@@ -1798,6 +1798,26 @@ function legend_custom() {
|
||||
});
|
||||
}
|
||||
|
||||
function legend_tiles() {
|
||||
const chart = c3.generate({
|
||||
data: {
|
||||
columns: [
|
||||
["sample", 30, 200, 100, 400, 150, 250]
|
||||
]
|
||||
},
|
||||
legend: {
|
||||
// amount of padding to put between each legend element
|
||||
padding: 5,
|
||||
// define custom height and width for the legend item tile
|
||||
item: {
|
||||
tile: {
|
||||
width: 15,
|
||||
height: 2
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// Tooltip Tests
|
||||
/////////////////////
|
||||
|
||||
20
types/c3/index.d.ts
vendored
20
types/c3/index.d.ts
vendored
@@ -1,9 +1,10 @@
|
||||
// Type definitions for C3js 0.5
|
||||
// Type definitions for C3js 0.6
|
||||
// Project: http://c3js.org/
|
||||
// Definitions by: Marc Climent <https://github.com/mcliment>
|
||||
// Gerin Jacob <https://github.com/gerinjacob>
|
||||
// Bernd Hacker <https://github.com/denyo>
|
||||
// Dzmitry Shyndzin <https://github.com/dmitryshindin>
|
||||
// Tim Niemueller <https://github.com/timn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -700,6 +701,10 @@ export interface LegendOptions {
|
||||
y?: number;
|
||||
step?: number;
|
||||
};
|
||||
/**
|
||||
* Padding between legend elements.
|
||||
*/
|
||||
padding?: number;
|
||||
|
||||
item?: {
|
||||
/**
|
||||
@@ -714,6 +719,19 @@ export interface LegendOptions {
|
||||
* Set mouseout event handler to the legend item.
|
||||
*/
|
||||
onmouseout?(id: any): void;
|
||||
/**
|
||||
* Tile settings for legend color display.
|
||||
*/
|
||||
tile?: {
|
||||
/**
|
||||
* Tile width.
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* Tile height
|
||||
*/
|
||||
height?: number;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user