lightweight-charts-react-components 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -188,6 +188,12 @@ const volumeData = [
188
188
  ];
189
189
 
190
190
  const chartOptions = {
191
+ // Important to set width and height for the chart
192
+ // Otherwise make chart container scale to its parent size by using containerProps, like:
193
+ // <Chart containerProps={{ style: { width: '100%', height: '100%' } }} />
194
+ // Chart itself automatically resizes to fit its container
195
+ width: 600,
196
+ height: 400,
191
197
  // Chart options can be customized here
192
198
  };
193
199
 
@@ -215,6 +221,13 @@ const App = () => {
215
221
  export { App };
216
222
  ```
217
223
 
224
+ ### Chart Container Sizing
225
+
226
+ The `Chart` component requires explicit width and height to render correctly. You can set these dimensions directly via the `options` prop or make the chart container scale to its parent size using the `containerProps` prop.
227
+ Note that the chart will automatically resize to fit its container.
228
+
229
+ There may be cases where the chart's parent HTML element has no size defined (for example, when the parent is a flex container with no defined height). In such cases, you need to ensure that the parent element has a defined size (width and height) for the chart to render properly.
230
+
218
231
  ## Examples
219
232
 
220
233
  The [examples](https://github.com/ukorvl/lightweight-charts-react-components/blob/main/examples/) app itself is a [Demo](https://ukorvl.github.io/lightweight-charts-react-components/) web application, but it contains a lot of examples of how to use the library. You can find the source code in the [samples folder](https://github.com/ukorvl/lightweight-charts-react-components/blob/main/examples/src/samples).