From 9fc53bfa79eef09048574b66da11b6bb71b8e631 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:35:05 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/ui/chart/docs/general/device-pixel-ratio.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 js/ui/chart/docs/general/device-pixel-ratio.md diff --git a/js/ui/chart/docs/general/device-pixel-ratio.md b/js/ui/chart/docs/general/device-pixel-ratio.md new file mode 100644 index 0000000..6e6e96e --- /dev/null +++ b/js/ui/chart/docs/general/device-pixel-ratio.md @@ -0,0 +1,13 @@ +# Device Pixel Ratio + +By default the chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g. Retina displays). + +For applications where a chart will be converted to a bitmap, or printed to a higher DPI medium it can be desirable to render the chart at a higher resolution than the default. + +Setting `devicePixelRatio` to a value other than 1 will force the canvas size to be scaled by that amount, relative to the container size. There should be no visible difference on screen; the difference will only be visible when the image is zoomed or printed. + +## Configuration Options + +| Name | Type | Default | Description +| ---- | ---- | ------- | ----------- +| `devicePixelRatio` | `number` | `window.devicePixelRatio` | Override the window's default devicePixelRatio.