# 设备像素比
¥Device Pixel Ratio
默认情况下,图表的画布将使用 1:1 像素比,除非物理显示器具有更高的像素比(例如 Retina 显示器)。
¥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).
对于将图表转换为位图或打印到更高 DPI 介质的应用,可能需要以比默认值更高的分辨率渲染图表。
¥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.
将 devicePixelRatio
设置为 1 以外的值将强制画布大小相对于容器大小按该数量缩放。屏幕上应该没有明显的差异;只有在缩放或打印图片时才能看到差异。
¥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
命名空间:options
¥Namespace: options
名称 | 类型 | 默认 | 描述 |
---|---|---|---|
devicePixelRatio | number | window.devicePixelRatio | 覆盖窗口的默认 devicePixelRatio。 |