21 lines
466 B
React
21 lines
466 B
React
---
|
|
label: price-chart voorbeeld
|
|
description: Prijsgrafiek met forecast-overlay
|
|
type: price-chart
|
|
author: maik
|
|
---
|
|
|
|
import React from 'react';
|
|
|
|
export default function PriceChartTemplate({ data }) {
|
|
const prices = data?.prices ?? [];
|
|
const max = Math.max(...prices, 1);
|
|
return (
|
|
<div className="widget-price-chart">
|
|
{prices.map((p, i) => (
|
|
<div key={i} className="bar" style={{ height: `${(p / max) * 100}%` }} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|