MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / createOptions

Function createOptions

examples/chart-sync/main.ts:28–47  ·  view source on GitHub ↗
(title: string, data: ReadonlyArray<DataPoint>, color: string)

Source from the content-addressed store, hash-verified

26};
27
28const createOptions = (title: string, data: ReadonlyArray<DataPoint>, color: string): ChartGPUOptions => {
29 const xMax = Math.PI * 2;
30 return {
31 grid: { left: 70, right: 24, top: 24, bottom: 56 },
32 xAxis: { type: 'value', min: 0, max: xMax, name: 'Angle (rad)' },
33 yAxis: { type: 'value', min: -1.2, max: 1.2, name: title },
34 palette: [color],
35 tooltip: { trigger: 'axis' },
36 animation: { duration: 900, easing: 'cubicOut', delay: 0 },
37 series: [
38 {
39 type: 'line',
40 name: title,
41 data,
42 color,
43 lineStyle: { width: 2, opacity: 1 },
44 },
45 ],
46 };
47};
48
49async function main() {
50 const containerA = document.getElementById('chart-a');

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected