@alicloud/cloud-charts
Version:

88 lines (87 loc) • 2.97 kB
TypeScript
import { Chart, Types, BaseChartConfig, Colors, G2Dependents } from '../common/types';
import Base from '../common/Base';
import '@antv/data-set/lib/transform/percent';
import '@antv/data-set/lib/transform/aggregate';
import { XAxisConfig } from '../common/rectXAxis';
import { YAxisConfig } from '../common/rectYAxis';
import { TooltipConfig } from '../common/rectTooltip';
import { LegendConfig } from '../common/rectLegend';
import { GuideConfig } from '../common/guide';
import { LabelConfig } from '../common/label';
import { GeomSizeConfig } from '../common/geomSize';
import { GeomStyleConfig } from '../common/geomStyle';
import { ZoomConfig } from '../common/rectZoom';
import { ScrollbarConfig } from '../common/rectScrollbar';
import { SliderConfig } from '../common/rectSlider';
import './index.scss';
interface FacetConfig {
type?: 'mirror' | 'rect' | 'list' | 'matrix' | 'circle' | 'tree';
transpose?: boolean;
/**
* @title facet view padding。
*/
padding?: number[];
/**
* @title 分面 view 之间的间隔, 百分比或像素值
*/
spacing?: [number | string, number | string];
/**
* @title 是否显示标题。
*/
showTitle?: boolean;
title?: {
/** x 方向偏移 */
offsetX?: number;
/** y 方向偏移 */
offsetY?: number;
/** 格式化 */
formatter?: (val: any) => any;
} & Omit<G2Dependents.EnhancedTextCfg, 'content'>;
}
interface ColumnConfig {
reflect?: boolean;
top?: number;
showRanking?: boolean;
rankConfig?: any;
}
export interface WbarConfig extends BaseChartConfig, ZoomConfig, ScrollbarConfig, SliderConfig {
colors?: Colors;
xAxis?: (Types.ScaleOption & XAxisConfig) | false;
yAxis?: (Types.ScaleOption & YAxisConfig) | false;
legend?: LegendConfig | boolean;
tooltip?: TooltipConfig | boolean;
guide?: GuideConfig;
label?: LabelConfig | boolean;
column?: ColumnConfig | boolean;
dodge?: boolean;
dodgeStack?: boolean;
stack?: boolean;
stackReverse?: boolean;
marginRatio?: number;
grid?: boolean;
facet?: boolean | FacetConfig;
size?: GeomSizeConfig;
polar?: boolean;
innerRadius?: number;
geomStyle?: GeomStyleConfig;
minSize?: number;
maxSize?: number;
/** 默认宽度占比,interval类型和schema类型通用 */
columnWidthRatio?: number;
/** 像素级组内间距 */
dodgePadding?: number;
/** 像素级柱间宽度(组间距),调整offset */
intervalPadding?: number;
/** 百分比堆叠柱状图 */
percentage?: boolean;
showStackSum?: boolean;
}
export declare class Bar extends Base<WbarConfig> {
chartName: string;
private barDataView;
getDefaultConfig(): WbarConfig;
init(chart: Chart, config: WbarConfig, data: any): void;
changeData(chart: Chart, config: WbarConfig, data: any): void;
}
declare const Wbar: typeof Bar;
export default Wbar;