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

标题的优先级 advisor应大于G2 Plot的配置;导出的配置信息建议format一下; #4

Closed
realeve opened this issue Jan 7, 2020 · 2 comments

Comments

@realeve
Copy link

realeve commented Jan 7, 2020

问题1:标题的优先级 advisor应大于G2 Plot的配置

目前如果设置了configs,advisor的标题无法生效

import { autoChart, AutoChartOptions } from '@antv/chart-advisor';
 
export interface IAChart extends AutoChartOptions {
  data: any[];
  [key: string]: any;
}

  const config = {
    configs: {
      title: { visible: true, text: '百分比堆叠条形图(G2 Plot配置)' },
      description: { visible: true, text: '一个简单的百分比堆叠条形图(G2 Plot配置)' },
      legend: { flipPage: false },
      xAxis: { label: { visible: true }, title: { visible: true, text: '月份' } },
      yAxis: { title: { text: '数值' } },
      label: { position: 'right' },
      xField: 'x',
      yField: 'y',
      stackField: 'serie',
      smooth: true,
      point: { visible: true },
      width: 800,
      height: 600,
    },
    type: 'Area',
  };

  const option: IAChart = {
    data,
    toolbar: true,
    title: '百分比堆叠条形图(advisor配置)',
    description: '一个简单的百分比堆叠条形图(advisor配置)',
    theme: 'light',
    config,
    development: true,
    preferences: {
      canvasLayout: 'landscape',
    },
  };

渲染结果如下:
image

如果把G2 Plot中的title配置信息删除,保留advisor的title配置,渲染结果不含标题;

问题2: perferences中的canvasLayout修改之后无变化;

优化建议: 导出的配置信息建议format;

@neoddish
Copy link
Member

neoddish commented Jan 7, 2020

标题的优先级 advisor应大于G2 Plot的配置

这个我们会优化,谢谢建议。

@neoddish
Copy link
Member

neoddish commented Jan 7, 2020

perferences中的canvasLayout修改之后无变化

canvasLayout 可能在正式版中会被废弃,由更好的方案代替。

@realeve realeve closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants