/**
 * Datart
 *
 * Copyright 2021
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { ChartConfig } from 'app/types/ChartConfig';

const config: ChartConfig = {
  datas: [
    {
      label: 'metrics',
      key: 'metrics',
      required: true,
      allowSameField: false,
      type: 'aggregate',
      limit: [1,3],
    },
    {
      label: 'filter',
      key: 'filter',
      type: 'filter',
      allowSameField: true,
    },
  ],
  styles: [
    {
      label: 'metricChart.title',
      key: 'commonTitle',
      comType: 'group',
      rows: [
        {
          label: 'metricChart.nodeWidth',
          key: 'nodeWidth',
          default: 10,
          comType: 'inputNumber',
        },
        {
          label: 'metricChart.nodeGap',
          key: 'nodeGap',
          default: 8,
          comType: 'inputNumber',
        },
        {
          label: 'metricChart.nodeAlign',
          key: 'nodeAlign',
          default: 'left',
          comType: 'select',
          options: {
            items: [
              { label: '左对齐', value: 'left' },
              { label: '右对齐', value: 'right' },
              { label: '居中', value: 'center' },
              { label: '两端对齐', value: 'justify' },
            ],
          },
        },
      ],
    },
    {
      label: 'metricChart.label',
      key: 'label',
      comType: 'group',
      rows: [
        {
          label: 'common.showLabel',
          key: 'showLabel',
          default: true,
          comType: 'checkbox',
        },
        {
          label: 'common.font',
          key: 'font',
          comType: 'font',
        },
      ],
    },
    {
      label: 'metricChart.nodeStyle',
      key: 'nodeStyle',
      comType: 'group',
      rows: [
        {
          label: 'metricChart.hoverColor',
          key: 'hoverColor',
          default: 'red',
          comType: 'fontColor',
        },
      ],
    },
  ],
  settings: [],
  interactions: [],
  i18ns: [
    {
      lang: 'zh-CN',
      translation: {
        section: {
          legend: '图例',
          detail: '详细信息',
        },
        graph:{
          name:{
            metricChart:'指标图'
          }
        },
        common: {
          showLabel: '显示标签',
          rotate: '旋转角度',
          position: '位置',
        },
        pie: {
          title: '饼图',
          circle: '环状',
          roseType: '南丁格尔玫瑰',
        },
        label: {
          title: '标签',
          showLabel: '显示标签',
          position: '位置',
          positionType: {
            outside: '外侧',
            inside: '内部',
            center: '中心',
          },
          showName: '维度值',
          showPercent: '百分比',
          showValue: '指标值',
          avoidOverlap: '强制显示所有标签',
        },
        legend: {
          title: '图例',
          showLegend: '显示图例',
          type: '图例类型',
          selectAll: '图例全选',
          position: '图例位置',
          height: '图例高度',
        },
        reference: {
          title: '参考线',
          open: '点击参考线配置',
        },
        tooltip: {
          title: '提示信息',
          showPercentage: '增加百分比显示',
        },
      },
    },
    {
      lang: 'en-US',
      translation: {
        section: {
          legend: 'Legend',
          detail: 'Detail',
        },
        common: {
          showLabel: 'Show Label',
          rotate: 'Rotate',
          position: 'Position',
          height: 'Height',
        },
        pie: {
          title: 'Pie',
          circle: 'Circle',
          roseType: 'Rose',
        },
        label: {
          title: 'Label',
          showLabel: 'Show Label',
          position: 'Position',
          positionType: {
            outside: 'Outside',
            inside: 'Inside',
            center: 'Center',
          },
          showName: 'Show Name',
          showPercent: 'Show Percentage',
          showValue: 'Show Value',
          avoidOverlap: 'Force display of all labels',
        },
        legend: {
          title: 'Legend',
          showLegend: 'Show Legend',
          type: 'Type',
          selectAll: 'Select All',
          position: 'Position',
          height: 'Height',
        },
        reference: {
          title: 'Reference',
          open: 'Open',
        },
        tooltip: {
          title: 'Tooltip',
          showPercentage: 'Show Percentage',
        },
      },
    },
  ],
};

export default config;
