Skip to content

Commit 68f7b72

Browse files
authored
examples for chartgpu_serie
Added support for sine and cosine series in chartgpu_serie.
1 parent 6a8cc53 commit 68f7b72

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

examples/chartgpu_serie.R

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,37 @@ data.frame(
1717
color = "#b22222",
1818
lineStyle = list(width = 4)
1919
)
20+
21+
# You can pass data through chartgpu_serie
22+
chartgpu() |>
23+
chartgpu_serie(
24+
name = "sin",
25+
label = "Sine",
26+
color = "#228B22",
27+
data = data.frame(
28+
x = seq(-3, 7, by = 1/8),
29+
sin = sin(seq(-3, 7, by = 1/8))
30+
)
31+
)
32+
33+
# With 2 series
34+
chartgpu() |>
35+
chartgpu_serie(
36+
name = "sin",
37+
label = "Sine",
38+
color = "#228B22",
39+
data = data.frame(
40+
x = seq(-3, 7, by = 1/8),
41+
sin = sin(seq(-3, 7, by = 1/8))
42+
)
43+
) |>
44+
chartgpu_serie(
45+
name = "cos",
46+
label = "Cosine",
47+
color = "#b22222",
48+
type = "area",
49+
data = data.frame(
50+
x = seq(-3, 7, by = 1/8),
51+
cos = cos(seq(-3, 7, by = 1/8))
52+
)
53+
)

0 commit comments

Comments
 (0)