모든 차트에 라벨을 넣어야합니다. 그러나 차트의 밀도에 따라 레이블이 겹칩니다. 샘플 첨부.DevExpress js 차트에서 레이블 배치가 겹치지 않도록 수정하는 방법은 무엇입니까?
분리해야합니다. 방법?
lib의 CSS를 수정하지 않았습니다. 마지막 버전 사용.
var labelPercent = {
visible: true,
format: 'percent',
precision: 1,
};
var dataSource = [
{
"Aeropuertos": 0.003,
"AguaFacilidades": 0.016,
"CallesPuentes": 0.183,
"ConstruccionResidencialNO": 0.542,
"PetroleoGas": 0.071,
"PlantasEnergia": 0.11,
"PuertosFluviales": 0.052,
"ViasFerreas": 0.023,
"Year": "2011"
},
{
"Aeropuertos": 0.01,
"AguaFacilidades": 0.019,
"CallesPuentes": 0.19,
"ConstruccionResidencialNO": 0.542,
"PetroleoGas": 0.079,
"PlantasEnergia": 0.09,
"PuertosFluviales": 0.029,
"ViasFerreas": 0.04,
"Year": "2012"
},
{
"Aeropuertos": 0.01,
"AguaFacilidades": 0.019,
"CallesPuentes": 0.191,
"ConstruccionResidencialNO": 0.541,
"PetroleoGas": 0.082,
"PlantasEnergia": 0.088,
"PuertosFluviales": 0.029,
"ViasFerreas": 0.04,
"Year": "2013"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.019,
"CallesPuentes": 0.19,
"ConstruccionResidencialNO": 0.539,
"PetroleoGas": 0.085,
"PlantasEnergia": 0.085,
"PuertosFluviales": 0.029,
"ViasFerreas": 0.042,
"Year": "2014E"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.018,
"CallesPuentes": 0.191,
"ConstruccionResidencialNO": 0.536,
"PetroleoGas": 0.09,
"PlantasEnergia": 0.084,
"PuertosFluviales": 0.029,
"ViasFerreas": 0.043,
"Year": "2015E"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.017,
"CallesPuentes": 0.192,
"ConstruccionResidencialNO": 0.529,
"PetroleoGas": 0.096,
"PlantasEnergia": 0.084,
"PuertosFluviales": 0.028,
"ViasFerreas": 0.044,
"Year": "2016E"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.017,
"CallesPuentes": 0.195,
"ConstruccionResidencialNO": 0.521,
"PetroleoGas": 0.102,
"PlantasEnergia": 0.084,
"PuertosFluviales": 0.028,
"ViasFerreas": 0.045,
"Year": "2017E"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.016,
"CallesPuentes": 0.196,
"ConstruccionResidencialNO": 0.514,
"PetroleoGas": 0.108,
"PlantasEnergia": 0.084,
"PuertosFluviales": 0.028,
"ViasFerreas": 0.045,
"Year": "2018E"
},
{
"Aeropuertos": 0.009,
"AguaFacilidades": 0.015,
"CallesPuentes": 0.197,
"ConstruccionResidencialNO": 0.508,
"PetroleoGas": 0.115,
"PlantasEnergia": 0.083,
"PuertosFluviales": 0.027,
"ViasFerreas": 0.046,
"Year": "2019E"
},
{
"Aeropuertos": 0.008,
"AguaFacilidades": 0.014,
"CallesPuentes": 0.198,
"ConstruccionResidencialNO": 0.501,
"PetroleoGas": 0.123,
"PlantasEnergia": 0.082,
"PuertosFluviales": 0.027,
"ViasFerreas": 0.047,
"Year": "2020E"
},
{
"Aeropuertos": 0.008,
"AguaFacilidades": 0.014,
"CallesPuentes": 0.199,
"ConstruccionResidencialNO": 0.493,
"PetroleoGas": 0.132,
"PlantasEnergia": 0.08,
"PuertosFluviales": 0.027,
"ViasFerreas": 0.047,
"Year": "2021E"
},
{
"Aeropuertos": 0.008,
"AguaFacilidades": 0.013,
"CallesPuentes": 0.199,
"ConstruccionResidencialNO": 0.485,
"PetroleoGas": 0.141,
"PlantasEnergia": 0.079,
"PuertosFluviales": 0.026,
"ViasFerreas": 0.048,
"Year": "2022E"
}
];
$("#container").dxChart({
dataSource: dataSource,
commonSeriesSettings: {
type: "fullStackedArea",
argumentField: "Year"
},
series: [
{
valueField: 'CallesPuentes',
name: 'Calles y puentes',
label: labelPercent,
},
{
valueField: 'ViasFerreas',
name: 'Vías ferreas',
label: labelPercent,
},
{
valueField: 'Aeropuertos',
name: 'Aeropuertos',
label: labelPercent,
},
{
valueField: 'PuertosFluviales',
name: 'Puertos - Vías fluviales',
label: labelPercent,
},
{
valueField: 'PetroleoGas',
name: 'Petróleo y gas',
label: labelPercent,
},
{
valueField: 'PlantasEnergia',
name: 'Plantas de energía',
label: labelPercent,
},
{
valueField: 'AguaFacilidades',
name: 'Agua y facilidades sanitarias',
label: labelPercent,
},
{
valueField: 'ConstruccionResidencialNO',
name: 'Construcción Residencial y No Residencial',
label: labelPercent,
}
],
title: "Test",
argumentAxis:{
valueMarginsEnabled: false
},
tooltip: {
enabled: true,
},
valueAxis:[{
grid: {
visible: true
}
},
{
min: 0,
name: 'valueAxis',
position: 'right',
grid: {
visible: true
},
},
{
min: 0,
name: 'valueAxis2',
position: 'right',
grid: {
visible: true
},
}],
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center"
}
});
나는 이것을 시도하고 도표에 어떤 변화도 보지 않는다. .dxc-labels-group의 크기는 동일하게 유지됩니다. – mamcx
Chrome (F12) 콘솔에이 코드를 추가하고 Enter 키를 누 릅니? 차트 코드 영역에 복사/붙여 넣기하면 작동하지 않습니다. –
js 파일에 직접 입력했습니다. 하지만 콘솔 작업. – mamcx