<commit_before>import echarts from 'echarts';

let myChart = echarts.init(document.getElementById('root'));
let colors = ['#5793f3', '#d14a61', '#675bba'];
let option = {
  title: {
    text: "一周气温变化",
    subtext: "虚构"
  },
  color: colors,
  tooltip: {
    trigfer: 'axis',
    // 使用游标来定位某一x轴上的y轴值
    axisPointer: {
      type: 'cross'
    }
  },
  legend: {
    data: ['最高气温', '最低气温']
  },
  // 调整图形上下的填充
  // grid: {
  //       top: 70,
  //       bottom: 50
  // },
  toolbox: {
    show: true,
    feature: {
      dataZoom: {
        yAxisIndex: 'none'
      },
      dataView: { readonly: false },
      magicType: { type: ['line', 'bar'] },
      restore: {},
      saveAsImage: {}
    }
  },
  // 双x轴使用数组
  xAxis: [
    {
      type: 'category',
      boundaryGap: false,
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      axisPointer: {
        label: {
          formatter: function (params) {
            return params.value + ' 气温 '
              + '最高' + (params.seriesData.length ? ': ' + params.seriesData[0].data : '')
              + '\t'
              + '最低' + (params.seriesData.length ? ': ' + params.seriesData[1].data : '')
          }
        }
      }
    },
    {
      type: 'category',
      boundaryGap: false,
      data: ['周一','周二','周三','周四','周五','周六','周日']
    }
  ],
  yAxis: {
    type: 'value',
    axisLabel: {
      formatter: '{value} °C'
    }
  },
  series: [
    {
      name: '最高气温',
      type: 'line',
      data:[11, 11, 15, 13, 12, 10, 20],
      // 点与点之间的连线光滑度
      // smooth: true,
      markPoint: {
        data: [
          {type: 'max', name: '最大值'},
          {type: 'min', name: '最小值'}
        ]
      },
      markLine: {
        data: [
          {type: 'average', name: '平均值'}
        ]
      }
    },
    {
      name: '最低气温',
      type: 'line',
      data: [1, -2, 2, 7, -5, 3, 4, 6, 0],<commit_msg>增加缩放功能<commit_after>import echarts from 'echarts';

let myChart = echarts.init(document.getElementById('root'));
let colors = ['#5793f3', '#d14a61', '#675bba'];
let option = {
  title: {
    text: "一周气温变化",
    subtext: "虚构"
  },
  color: colors,
  tooltip: {
    trigfer: 'axis',
    // 使用游标来定位某一x轴上的y轴值
    axisPointer: {
      type: 'cross'
    }
  },
  legend: {
    data: ['最高气温', '最低气温']
  },
  // 调整图形上下的填充
  // grid: {
  //       top: 70,
  //       bottom: 50
  // },
  toolbox: {
    show: true,
    feature: {
      dataZoom: {
        yAxisIndex: 'none'
      },
      dataView: { readonly: false },
      magicType: { type: ['line', 'bar'] },
      restore: {},
      saveAsImage: {}
    }
  },
  // 双x轴使用数组
  xAxis: [
    {
      type: 'category',
      boundaryGap: false,
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      axisPointer: {
        label: {
          formatter: function (params) {
            return params.value + ' 气温 '
              + '最高' + (params.seriesData.length ? ': ' + params.seriesData[0].data : '')
              + '\t'
              + '最低' + (params.seriesData.length ? ': ' + params.seriesData[1].data : '')
          }
        }
      }
    },
    {
      type: 'category',
      boundaryGap: false,
      data: ['周一','周二','周三','周四','周五','周六','周日']
    }
  ],
  yAxis: {
    type: 'value',
    axisLabel: {
      formatter: '{value} °C'
    }
  },
  dataZoom: [
    {
      type: 'slider',
      xAxisIndex: 0,
      filterMode: 'empty'
    },
    {
      type: 'slider',
      yAxisIndex: 0,
      filterMode: 'empty'
    },
    {
      type: 'inside',
      xAxisIndex: 0,
      filterMode: 'empty'
    },
    {
      type: 'inside',
      yAxisIndex: 0,
      filterMode: 'empty'
    }
  ],
  series: [
    {
      name: '最高气温',
      type: 'line',
      data:[11, 11, 15, 13, 12, 10, 20],
      // 点与点之间的连线光滑度
      // smooth: true,
      markPoint: {
        data: [
          {type: 'max', name: '最大值'},
          {type: 'min', name: '最小值'}
        ]
      },
      markLine: {
        data: [
          {type: 'average', name: '平均值'}
        ]
      }
    },
    {
      name: '最低气温',
      type: 'line',
      data: [1, -2, 2, 7, -5, 3, 4, 6, 0],
{'fraction_non_alphanumeric': 0.19420574515099434, 'fraction_numerical': 0.0211146575006138, 'mean_word_length': 1.604859335038363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3907505', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1707, 'n_words': 294}