vbenadmin中使用echart

<template>
  <div ref="chartRef" style="height: 400px; width: 100%"></div>
</template>
<script lang="ts" setup>
  import { onMounted, ref, Ref, defineProps, toRefs } from 'vue';
  import { useECharts } from '/@/hooks/web/useECharts';
  
  const chartRef = ref<HTMLDivElement | null>(null);
  const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
  const props = defineProps({
    data: {
      type: Object,
      default: () => {},
    },
  });
  const { data } = toRefs(props);

  onMounted(async () => {

    await setOptions({
      title: {
        text: '报名中课程'
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow'
        }
      },
      xAxis: {
        name: '课程名',
        type: 'category',
        data: data.value.xData
      },
      yAxis: {
        type: 'value',
        name: '学生报名人数'
      },
      series: [
        {
          data: data.value.yData,
          itemStyle: {
            color:'#546fc6'
          },
          label: {
            show: true,
            position: 'inside'
          },
          type: 'bar'
        }
      ]
    });
  });
</script>

要在vbenadmin+vue3网页与.net使用FastReport实现自主设计打印,需要按照以下步骤进行: 1. 创建报表模板 使用FastReport Designer创建报表模板。你可以在模板添加数据源和控件,设计报表的布局和样式。将报表模板保存为.frx格式。 2. 在.NET添加FastReport引用 在你的.NET项目,需要添加FastReport引用。你可以通过NuGet包管理器或手动添加引用的方式将FastReport集成到项目。 3. 加载报表模板 在你的.NET应用程序使用FastReport API加载报表模板并填充数据。你可以通过以下代码加载报表模板: ``` FastReport.Report report = new FastReport.Report(); report.Load("report.frx"); ``` 4. 填充数据 使用FastReport API填充报表模板的数据。你可以将数据源绑定到报表模板的控件,或者在代码直接为控件赋值。 ``` report.SetParameterValue("参数名", "参数值"); ``` 5. 预览和打印报表 使用FastReport API预览和打印报表。你可以通过以下代码预览报表: ``` report.Show(); ``` 或者通过以下代码打印报表: ``` report.Print(); ``` 6. 将报表嵌入到vbenadmin+vue3网页 在你的vbenadmin+vue3网页使用iframe将报表嵌入到网页。你可以通过以下代码将报表嵌入到网页: ``` <iframe src="report.html" width="100%" height="600px"></iframe> ``` 其,report.html是FastReport生成的报表文件。 以上就是使用FastReport实现自主设计打印的基本步骤。需要注意的是,在vbenadmin+vue3网页嵌入报表时,需要确保报表文件的路径正确,并且报表文件可以被访问。希望对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值