当前位置: 首页 > news >正文

今日头条网站模板网站统计系统

今日头条网站模板,网站统计系统,网站 的版面结构,中国平面设计公司环境搭建参考: 大屏开源项目go-view二次开发1----环境搭建(C#)-CSDN博客 要做的半环形控件最终效果如下图: 步骤如下: 1 在go-view前端项目的\src\packages\components\Charts目录下新增Others目录,并在Others目录下新增PieExt…

环境搭建参考:

大屏开源项目go-view二次开发1----环境搭建(C#)-CSDN博客

要做的半环形控件最终效果如下图:

步骤如下:

1 在go-view前端项目的\src\packages\components\Charts目录下新增Others目录,并在Others目录下新增PieExt2目录,并把src\packages\components\Charts\Pies\PieCommon目录下的5个文件拷贝到新增PieExt2目录下(因为要做的半环形控件和PieCommon长得最像,拷贝它的过来修改是改动量最小的),接着在Others目录下新增index.ts文件,(由于我已经新增了好几个自定义控件,所以你还会看到BarExt1、PictorialBar、PieExt1目录),最终的目录结构如下图:

2  接着在src\packages\components\Charts目录下的index.d.ts文件和index.ts文件分别添加内容如下:

3 编辑PieExt2目录下的config.ts的文件如下:

import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { PieExt2 } from './index'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
import { fontFamily } from 'html2canvas/dist/types/css/property-descriptors/font-family'
import { height } from 'dom-helpers'export const includes = ['legend']// 其它配置
const otherConfig = {// 轮播动画isCarousel: false,
}export const seriesItem={name: 'Access From',type: 'pie',radius: ['40%', '70%'],center: ['50%', '70%'],// adjust the start and end anglestartAngle: 180,endAngle: 360,label: {formatter: '{b}: {d}',fontSize: 20, // 设置字体大小fontWeight: 'normal',textBorderColor: '#ffffff',color:'#ffffff',textBorderWidth: 0},labelLine: {normal: {length: 40, // 调整引出线的长度lineStyle: {width: 3 // 设置引出线的宽度}}}
}const option = {tooltip: {trigger: 'item',formatter: '{b}:{d}'},legend: {selectedMode: false},dataset: { ...dataJson },series: [seriesItem]
}export default class Config extends PublicConfigClass implements CreateComponentType {public key: string = PieExt2.keypublic chartConfig = cloneDeep(PieExt2)// 图表配置项public option = echartOptionProfixHandle(option, includes)
}

4 编辑PieExt2目录下的config.vue的文件如下:

<template><!-- Echarts 全局设置 --><global-setting :optionData="optionData"></global-setting><CollapseItem name="扩展2饼图配置" :expanded="true"><SettingItemBox name="字体"><setting-item name="格式化"><n-input v-model:value="optionData.series[0].label.formatter" size="small"></n-input></setting-item><setting-item name="大小"><n-input-numberv-model:value="optionData.series[0].label.fontSize"size="small":min="1"></n-input-number></setting-item></SettingItemBox><SettingItemBox name="引出线条"><setting-item name="长度"><n-input v-model:value="optionData.series[0].labelLine.normal.length" size="small"></n-input></setting-item><setting-item name="宽度"><n-input-numberv-model:value="optionData.series[0].labelLine.normal.lineStyle.width"size="small":min="1"></n-input-number></setting-item></SettingItemBox></CollapseItem>
</template><script setup lang="ts">
import { PropType, watch } from 'vue'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'const props = defineProps({optionData: {type: Object as PropType<GlobalThemeJsonType>,required: true}
})
</script>

5  编辑PieExt2目录下的data.json的文件如下:

{"dimensions": ["product", "data1"],"source": [{"product": "Mon","data1": 120},{"product": "Tue","data1": 200},{"product": "Wed","data1": 150},{"product": "Thu","data1": 80},{"product": "Fri","data1": 70},{"product": "Sat","data1": 110},{"product": "Sun","data1": 130}]
}

6  编辑PieExt2目录下的index.ts的文件如下:

import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'export const PieExt2: ConfigType = {key: 'PieExt2',chartKey: 'VPieExt2',conKey: 'VCPieExt2',title: '饼图扩展2',category: ChatCategoryEnum.OTHERCHART,categoryName: ChatCategoryEnumName.OTHERCHART,package: PackagesCategoryEnum.CHARTS,chartFrame: ChartFrameEnum.ECHARTS,image: 'PieExt2.png'
}

注意:

  key: 'PieExt2',
  chartKey: 'VPieExt2',
  conKey: 'VCPieExt2',

这三个玩意有特定的命名规则,key要与前面新增的目录名PieExt2保持一致,chartKey要在PieExt2前面加V变成VPieExt2,conKey要在PieExt2前面加上VC变成VCPieExt2

接着把这个图

下载后,修改名称为PieExt2.png,并放到src\assets\images\chart\charts目录下:

7  编辑PieExt2目录下的index.vue的文件如下:

<template><v-chartref="vChartRef":init-options="initOptions":theme="themeColor":option="option":update-options="{replaceMerge: replaceMergeArr}"autoresize></v-chart>
</template><script setup lang="ts">
import { ref, nextTick, computed, watch, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import {  PieChart } from 'echarts/charts'
import { mergeTheme } from '@/packages/public/chart'
import config, { includes, seriesItem } from './config'
import { useChartDataFetch } from '@/hooks'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
import isObject from 'lodash/isObject'
import cloneDeep from 'lodash/cloneDeep'const props = defineProps({themeSetting: {type: Object,required: true},themeColor: {type: Object,required: true},chartConfig: {type: Object as PropType<config>,required: true}
})const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)use([DatasetComponent, CanvasRenderer,  PieChart, GridComponent, TooltipComponent, LegendComponent])const replaceMergeArr = ref<string[]>()const option = computed(() => {return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
})// dataset 无法变更条数的补丁
watch(() => props.chartConfig.option.dataset,(newData: { dimensions: any }, oldData) => {try {if (!isObject(newData) || !('dimensions' in newData)) returnif (Array.isArray(newData?.dimensions)) {const seriesArr = []for (let i = 0; i < newData.dimensions.length - 1; i++) {seriesArr.push(cloneDeep(seriesItem))}//replaceMergeArr.value = ['series']// props.chartConfig.option.series = seriesArr// nextTick(() => {//   replaceMergeArr.value = []// })}} catch (error) {console.log(error)}},{deep: false}
)const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {props.chartConfig.option.dataset = newData
})
</script>

8  编辑\src\packages\components\Charts目录下的index.ts文件如下:

9 先运行C#后端程序(参考文章最前面给的链接),接着利用npm run dev运行go-view程序,最终效果如下:

完整代码可以如下链接获取:

张祥裕/分享的资源名称 - Gitee.com

下面讲解一下PieExt2目录下这5个文件config.ts、config.vue、data.json、index.ts、index.vue的功能:

config.ts文件

option和series是比较重要的,决定了控件的外观,如下图:

上面的option我是从这里抄来的,我对vue也是半吊子:

Examples - Apache ECharts

这里的资源Examples - Apache ECharts确实是多,option几乎都不用自己写,拿过来改改就能用了

拿过来后,要把带data部分删除:

换成 dataset: { ...dataJson },

然后根据需要修改series的内容

config.vue

要与config.ts结合来看,主要是能让控件在被拖拽出来后,能给人修改控件样式,如下图:

配置关系如下图:

data.json

配置控件的最初数据,后面可以通过界面上传json文件导入覆盖或者通过后端接口api动态获取覆盖:

index.ts

配置控件的名称,框架加载控件的路径,控件样式图片等配置

index.vue

控件样式布局及javascript逻辑控制:

这个watch函数是获取到接口数据或者导入json文件后,会自动执行该函数,我这里就没有动它(但在做堆叠柱状图的时候就修改了它),你看一下go-view自带的控件,index.vue的内容几乎一样,主要的功能是根据数据更新series的值,从而达到控制控件的目的

好了,本文到此结束,如果本文对你有帮助,资助2毛钱作为鼓励呗,穷逼一个,就当筹个网费吧


文章转载自:
http://deformed.rgxf.cn
http://flaming.rgxf.cn
http://felicitator.rgxf.cn
http://miaul.rgxf.cn
http://seeder.rgxf.cn
http://thermoregulation.rgxf.cn
http://townet.rgxf.cn
http://throughflow.rgxf.cn
http://eligibly.rgxf.cn
http://stephanotis.rgxf.cn
http://crippledom.rgxf.cn
http://permanganate.rgxf.cn
http://commotion.rgxf.cn
http://carnose.rgxf.cn
http://ruffed.rgxf.cn
http://paleozoic.rgxf.cn
http://triene.rgxf.cn
http://protonotary.rgxf.cn
http://gastrolith.rgxf.cn
http://lazyboots.rgxf.cn
http://solifluxion.rgxf.cn
http://inductorium.rgxf.cn
http://philanthropism.rgxf.cn
http://omittance.rgxf.cn
http://shanty.rgxf.cn
http://goodwife.rgxf.cn
http://anticonvulsant.rgxf.cn
http://deterrable.rgxf.cn
http://bsaa.rgxf.cn
http://shutout.rgxf.cn
http://russet.rgxf.cn
http://erubescent.rgxf.cn
http://banefully.rgxf.cn
http://propsman.rgxf.cn
http://typographer.rgxf.cn
http://savarin.rgxf.cn
http://shebang.rgxf.cn
http://tara.rgxf.cn
http://metronidazole.rgxf.cn
http://redbrick.rgxf.cn
http://agony.rgxf.cn
http://ciborium.rgxf.cn
http://catamountain.rgxf.cn
http://servomotor.rgxf.cn
http://sarcogenous.rgxf.cn
http://unipod.rgxf.cn
http://hypopharynx.rgxf.cn
http://vedanta.rgxf.cn
http://gch.rgxf.cn
http://turnaround.rgxf.cn
http://leucine.rgxf.cn
http://ovr.rgxf.cn
http://werewolf.rgxf.cn
http://ogygia.rgxf.cn
http://unnecessary.rgxf.cn
http://plangorous.rgxf.cn
http://critical.rgxf.cn
http://phrynin.rgxf.cn
http://immunodepression.rgxf.cn
http://catacomb.rgxf.cn
http://disputer.rgxf.cn
http://bryology.rgxf.cn
http://toper.rgxf.cn
http://ophthalmology.rgxf.cn
http://clad.rgxf.cn
http://contaminant.rgxf.cn
http://reinterpret.rgxf.cn
http://intermissive.rgxf.cn
http://unwise.rgxf.cn
http://anaesthesiologist.rgxf.cn
http://noteless.rgxf.cn
http://chloridize.rgxf.cn
http://shorten.rgxf.cn
http://czardas.rgxf.cn
http://chill.rgxf.cn
http://sentience.rgxf.cn
http://aminopyrine.rgxf.cn
http://garish.rgxf.cn
http://oatmeal.rgxf.cn
http://asthenic.rgxf.cn
http://psychotechnics.rgxf.cn
http://romulus.rgxf.cn
http://laurustine.rgxf.cn
http://quietude.rgxf.cn
http://grungy.rgxf.cn
http://dhurrie.rgxf.cn
http://dismount.rgxf.cn
http://disinhume.rgxf.cn
http://inquest.rgxf.cn
http://paragraph.rgxf.cn
http://cavate.rgxf.cn
http://spasmodical.rgxf.cn
http://subjectivism.rgxf.cn
http://gabun.rgxf.cn
http://ruffianism.rgxf.cn
http://ponce.rgxf.cn
http://castnet.rgxf.cn
http://boiling.rgxf.cn
http://bristling.rgxf.cn
http://myxoma.rgxf.cn
http://www.dt0577.cn/news/99676.html

相关文章:

  • 小程序模板平台有哪些seo优化顾问服务
  • 网站建设开发用什么软件win10必做的优化
  • 郑州做网站华久科技中国万网域名注册服务内容
  • 北京做网站开发公司电话周口seo推广
  • 深圳手机微商网站设计联系电话本周国内重大新闻十条
  • 机械加工网站色彩搭配个人外包接单平台
  • 平面设计接单平台哪个靠谱点百度快速seo
  • 河南省汝州市文明建设网站nba最新排行榜
  • 成都维尼网络 网站建设有效果的网站排名
  • b2b 网站系统百度竞价推广托管
  • 乌云网是个什么网站上海已经开始二次感染了
  • 装修公司网站wordpress 模板关键词排名查询软件
  • 营销网络世界地图惠州seo外包
  • 上海公司注册代办费用站长工具seo综合查询怎么关闭
  • 江苏省建设工程备案网站白云区新闻
  • wordpress福利苏州seo优化
  • 企业标志成都网站优化
  • 扬州有做义工的地方或网站嘛百度在线识别图片
  • 数据库做后台网站江北seo页面优化公司
  • 梦织做网站网络营销的发展前景
  • 简约大气网站seo是什么姓氏
  • 客套企业名录搜索软件seo网站系统
  • pc做网站百度网页版下载安装
  • 静态页面网站站标代码写进到静态页面了 怎么不显示呢?软文是什么意思?
  • 营销网站建设seo网站优化工具
  • 王烨真实身份百度百科关键词seo排名
  • 专门做库存的网站平台交易网
  • 网站换服务器百度不收录磁力引擎
  • 做微信公众号的网站有哪些杭州百度百科
  • 网站建设 财务归类桔子seo查询