deno.land / x / billboardjs@3.6.0 / Chart / api / legend.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/** * Copyright (c) 2017 ~ present NAVER Corp. * billboard.js project is licensed under the MIT license *//** * Define legend * @ignore */const legend = { /** * Show legend for each target. * @function legend․show * @instance * @memberof Chart * @param {string|Array} targetIds * - If targetIds is given, specified target's legend will be shown. * - If only one target is the candidate, String can be passed. * - If no argument is given, all of target's legend will be shown. * @example * // Show legend for data1. * chart.legend.show("data1"); * * // Show legend for data1 and data2. * chart.legend.show(["data1", "data2"]); * * // Show all legend. * chart.legend.show(); */ show: function(targetIds?: string | string[]): void { const $$ = this.internal;
$$.showLegend($$.mapToTargetIds(targetIds)); $$.updateAndRedraw({withLegend: true}); },
/** * Hide legend for each target. * @function legend․hide * @instance * @memberof Chart * @param {string|Array} targetIds * - If targetIds is given, specified target's legend will be hidden. * - If only one target is the candidate, String can be passed. * - If no argument is given, all of target's legend will be hidden. * @example * // Hide legend for data1. * chart.legend.hide("data1"); * * // Hide legend for data1 and data2. * chart.legend.hide(["data1", "data2"]); * * // Hide all legend. * chart.legend.hide(); */ hide: function(targetIds?: string | string[]): void { const $$ = this.internal;
$$.hideLegend($$.mapToTargetIds(targetIds)); $$.updateAndRedraw({withLegend: true}); }};
export default {legend};
billboardjs

Version Info

Tagged at
2 years ago