占比图间距

This commit is contained in:
jingna 2025-07-30 09:09:54 +08:00
parent 4e726e671d
commit 8699bd5446
6 changed files with 23 additions and 25 deletions

View File

@ -88,7 +88,6 @@ defineExpose({
previewInit previewInit
}) })
onMounted(()=>{ onMounted(()=>{
console.log(state,999,'DePreviewPopDialog mounted')
}) })
</script> </script>

View File

@ -41,6 +41,7 @@
import { imgUrlTrans } from '@/utils/imgUtils' import { imgUrlTrans } from '@/utils/imgUtils'
import Board from '@/components/de-board/Board.vue' import Board from '@/components/de-board/Board.vue'
import ChartCarouselTooltip from '@/views/chart/components/js/g2plot_tooltip_carousel' import ChartCarouselTooltip from '@/views/chart/components/js/g2plot_tooltip_carousel'
import { getData } from '@/api/chart'
const dvMainStore = dvMainStoreWithOut() const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut() const snapshotStore = snapshotStoreWithOut()
const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore) const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore)
@ -57,6 +58,9 @@
element: { element: {
type: Object type: Object
}, },
view: {
type: Object,
},
editMode: { editMode: {
type: String, type: String,
require: false, require: false,
@ -594,6 +598,8 @@
// } // }
onMounted(() => { onMounted(() => {
console.log(props.view)
initview()
// if (element.value.propValue.length > 0) { // if (element.value.propValue.length > 0) {
// editableTabsValue.value = element.value.propValue[0].name // editableTabsValue.value = element.value.propValue[0].name
// } // }
@ -612,7 +618,12 @@
// viewToolTipsChange() // viewToolTipsChange()
// }, 1000) // }, 1000)
}) })
function initview(){
debugger
getData(props.view).then(res => {
console.log(res,378923749234)
})
}
// onBeforeUnmount(() => { // onBeforeUnmount(() => {
// if (['canvas', 'canvasDataV', 'edit'].includes(showPosition.value) && !mobileInPc.value) { // if (['canvas', 'canvasDataV', 'edit'].includes(showPosition.value) && !mobileInPc.value) {
// eventBus.off('onTabMoveIn-' + element.value.id, componentMoveIn) // eventBus.off('onTabMoveIn-' + element.value.id, componentMoveIn)
@ -626,6 +637,7 @@
// carouselTimer = null // carouselTimer = null
// } // }
// }) // })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.title-hidde-tab { .title-hidde-tab {

View File

@ -954,6 +954,7 @@ const onAxisChange = (e, axis: AxisType) => {
} }
const calcData = (view, resetDrill = false, updateQuery = '') => { const calcData = (view, resetDrill = false, updateQuery = '') => {
debugger
if ( if (
view.refreshTime === '' || view.refreshTime === '' ||
parseFloat(view.refreshTime).toString() === 'NaN' || parseFloat(view.refreshTime).toString() === 'NaN' ||
@ -999,8 +1000,6 @@ const changestatus = () => {
item.status = false item.status = false
} }
}) })
console.log(mapServer.value)
console.log(mapSelect.value)
// mapSelect.value = mapServer.value.find(server => server.status === true); // mapSelect.value = mapServer.value.find(server => server.status === true);
} }
const updatamap = () => { const updatamap = () => {

View File

@ -18,17 +18,10 @@ export class RichTextChartView extends AbstractChartView {
threshold: ['tableThreshold'], threshold: ['tableThreshold'],
'function-cfg': ['emptyDataStrategy'] 'function-cfg': ['emptyDataStrategy']
} }
axis: AxisType[] = ['xAxis', 'yAxis', 'filter'] axis: AxisType[] = ['xAxis', 'filter']
axisConfig: AxisConfig = { axisConfig: AxisConfig = {
xAxis: { xAxis: {
name: `${t('chart.dimension')}`, name: `${t('chart.drag_block_table_data_column')} / ${t('chart.dimension_or_quota')}`
type: 'd',
allowEmpty: true
},
yAxis: {
name: `${t('chart.quota')}`,
type: 'q',
allowEmpty: true
} }
} }
constructor() { constructor() {

View File

@ -93,7 +93,9 @@ export class G2Pie extends G2ChartView {
} }
const g2 = new Chart({ const g2 = new Chart({
container, container,
autoFit: true autoFit: true,
padding:0,
appendPadding:0
}) })
g2.coordinate('theta', { g2.coordinate('theta', {
radius: customAttr.basicStyle.radius / 100, radius: customAttr.basicStyle.radius / 100,
@ -122,20 +124,10 @@ export class G2Pie extends G2ChartView {
} }
g2.facet('rect', { g2.facet('rect', {
fields: ['name'], fields: ['name'],
padding: 20, padding: 0,
showTitle: false, showTitle: false,
eachView: (view, facet) => { eachView: (view, facet) => {
const data:any = facet.data const data:any = facet.data
// let color
// if(customAttr.basicStyle.seriesColor.length>0){
// customAttr.basicStyle.seriesColor.forEach((item) => {
// if(data.name == item.name){
// color = item.color
// }
// })
// }else{
// color = colorList[0]
// }
data.push({ name: '其他', value: 100 - data[0].value }) data.push({ name: '其他', value: 100 - data[0].value })
view.data(data) view.data(data)
view.coordinate('theta', { view.coordinate('theta', {

View File

@ -577,6 +577,7 @@ const queryData = (firstLoad = false) => {
} }
const calcData = params => { const calcData = params => {
debugger
dvMainStore.setLastViewRequestInfo(params.id, params.chartExtRequest) dvMainStore.setLastViewRequestInfo(params.id, params.chartExtRequest)
if (chartComponent?.value) { if (chartComponent?.value) {
if (['DeTree'].includes(view.value.type)) { if (['DeTree'].includes(view.value.type)) {
@ -595,6 +596,7 @@ const calcData = params => {
] ]
}) })
} else { } else {
console.log(chartComponent,'23213')
chartComponent?.value?.calcData?.(params, () => { chartComponent?.value?.calcData?.(params, () => {
loading.value = false loading.value = false
}) })
@ -1210,6 +1212,7 @@ const clearG2Tooltip = () => {
/> />
<de-tree-view <de-tree-view
v-else-if="showChartView(ChartLibraryType.DETREE)" v-else-if="showChartView(ChartLibraryType.DETREE)"
:view="view"
:scale="scale" :scale="scale"
:themes="canvasStyleData.dashboard.themeColor" :themes="canvasStyleData.dashboard.themeColor"
ref="chartComponent" ref="chartComponent"