Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分时图首次渲染后显示模糊 #10

Open
kf53916 opened this issue Nov 3, 2018 · 3 comments
Open

分时图首次渲染后显示模糊 #10

kf53916 opened this issue Nov 3, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@kf53916
Copy link

kf53916 commented Nov 3, 2018

您好:
为什么图表首次渲染完成后显示很模糊,是大小比例的问题吗?如何调整?

@Micjoyce
Copy link
Collaborator

Micjoyce commented Nov 4, 2018

@kf53916 这个可以通过配置的scale参数来修正

const syscfg = {
      scale: window.devicePixelRatio,  // 传入放大倍数
      axisPlatform: 'phone', // 'phone' | 'web'
      mainCanvas: {
        canvas: mainCanvas,
        context: mainCtx
      },
      cursorCanvas: {
        canvas: cursorCanvas,
        context: cursorCtx
      }
    }

加入在屏幕上设置的 canvas 的尺寸是 300 * 300 而你的屏幕是2dpr(两倍屏),此时你需要其实是要绘制一张 600 * 600 的图,然后在缩放1倍,这样子你看起来才是清晰的。

clchart 只需要通过设定 scale 这个参数,内部会帮你处理好的

@kf53916
Copy link
Author

kf53916 commented Nov 4, 2018

非常感谢您的回复,我发现分时图里面的x轴的开始时间是9:30,但是指标器可以指示到8:00,还有怎么自定义x轴时间的显示,比如在增加几个时间点,10:30,14:00等等。

@Micjoyce
Copy link
Collaborator

Micjoyce commented Nov 5, 2018

@kf53916 这个暂时没有支持,我找个时间支持一下。

可以通过配置

export const CHART_NOWVOL = {

然后在绘制x轴位置添加实现

_drawTxt(this.context, xx, yy, value,

@Micjoyce Micjoyce added the enhancement New feature or request label Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants