You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.3 KiB
36 lines
1.3 KiB
import { ChartwerkLinePod } from '../lib/main'; |
|
|
|
function App() { |
|
const startTime = 1590590148; |
|
const arrayLength = 20; |
|
const data1 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 40)]); |
|
const data2 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 10)]); |
|
const data3 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 20) + 90]); |
|
|
|
const options = { |
|
renderLegend: false, usePanning: false, |
|
axis: { |
|
y: { invert: false, range: [0, 350] }, |
|
y1: { isActive: true, range: [0, 10], ticksCount: 8 }, |
|
x: { format: 'time' } |
|
}, |
|
zoomEvents: { |
|
mouse: { zoom: { isActive: true, orientation: 'horizontal' } }, |
|
scroll: { zoom: { isActive: true, orientation: 'horizontal' } } |
|
} |
|
}; |
|
const series = [ |
|
{ target: 'test1', datapoints: data1, color: 'green', dashArray: '5,3', class: 'first', renderArea: true }, |
|
{ target: 'test2', datapoints: data2, color: 'blue', yOrientation: 'right' }, |
|
{ target: 'test3', datapoints: data3, color: 'orange' }, |
|
]; |
|
|
|
return ( |
|
<> |
|
{/* @ts-ignore */} |
|
<ChartwerkLinePod id="demo" series={series} options={options}></ChartwerkLinePod> |
|
</> |
|
); |
|
} |
|
|
|
export default App;
|
|
|