From 53eed0d24ed961f8684923ed9d54087b4f767357 Mon Sep 17 00:00:00 2001 From: Vyacheslav Date: Tue, 16 May 2023 10:56:40 +0600 Subject: [PATCH] fix: minor --- README.md | 6 +++--- src/chart.tsx | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e34752..d9b194e 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ function MyChart() { | Prop | Description | Type | |-------------|------------------------------------------------|---------| | width | The width of the chart canvas in pixels. | number \| undefined | -| height | The height of the chart canvas in pixels. | number \ | undefined | +| height | The height of the chart canvas in pixels. | number \| undefined | | fallback | A fallback element to display when chart fails. | JSX.Element | | type | The type of the chart. | keyof [ChartTypeRegistry](https://www.chartjs.org/docs/latest/api/interfaces/ChartTypeRegistry.html) | -| data | The chart data object. | [ChartData](https://www.chartjs.org/docs/latest/api/interfaces/ChartData.html) \ | undefined | -| options | The chart options object. | [ChartOptions](https://www.chartjs.org/docs/latest/api/interfaces/CoreChartOptions.html) \ | undefined | +| data | The chart data object. | [ChartData](https://www.chartjs.org/docs/latest/api/interfaces/ChartData.html) \| undefined | +| options | The chart options object. | [ChartOptions](https://www.chartjs.org/docs/latest/api/interfaces/CoreChartOptions.html) \| undefined | ## Examples Check out `/dev` folder and run the SolidJs application to see how it works. diff --git a/src/chart.tsx b/src/chart.tsx index f01c97a..a6a7ed1 100644 --- a/src/chart.tsx +++ b/src/chart.tsx @@ -1,4 +1,4 @@ -import Chart, { ChartData, ChartItem } from 'chart.js/auto' +import Chart, { ChartData, ChartItem, ChartOptions } from 'chart.js/auto' import { createEffect, mergeProps, on, onCleanup, onMount } from 'solid-js' import { unwrap } from 'solid-js/store' import { ChartJsProps } from './types' @@ -13,6 +13,7 @@ export default function ChartJs(props: ChartJsProps) { height: 512, type: 'line', data: {} as ChartData, + options: { responsive: true } as ChartOptions, }, props )