forked from p85126437/datagear
标签卡添加横排配置项"inline",配置项label.name简化为name,label.value简化为value
This commit is contained in:
parent
84b8772aa8
commit
4076fd9ccb
|
@ -5,7 +5,7 @@
|
|||
移除授权人设计概念;
|
||||
添加更多内置图表插件:嵌套饼图、地图热力图、路径图、下拉框;
|
||||
系统添加缓存支持;
|
||||
标签卡添加横排设置选项;
|
||||
ok 标签卡添加横排设置选项,简化配置项;
|
||||
|
||||
待定:
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -105,16 +105,11 @@
|
|||
filter: Alpha(Opacity=100);
|
||||
}
|
||||
|
||||
/*标签图表*/
|
||||
/*标签卡图表*/
|
||||
.dg-chart-label{
|
||||
position: relative;
|
||||
}
|
||||
.dg-chart-label .dg-chart-label-wrapper{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.dg-chart-label .dg-chart-label-wrapper .dg-chart-label-item .label-name{
|
||||
text-align: center;
|
||||
|
@ -124,6 +119,12 @@
|
|||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.dg-chart-label .dg-chart-label-wrapper.dg-chart-label-inline,
|
||||
.dg-chart-label .dg-chart-label-wrapper.dg-chart-label-inline .dg-chart-label-item,
|
||||
.dg-chart-label .dg-chart-label-wrapper.dg-chart-label-inline .dg-chart-label-item .label-name,
|
||||
.dg-chart-label .dg-chart-label-wrapper.dg-chart-label-inline .dg-chart-label-item .label-value{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*数据集参数值表单*/
|
||||
.dg-dspv-form{}
|
||||
|
|
|
@ -4694,23 +4694,30 @@
|
|||
//将在update中设置:
|
||||
//data
|
||||
|
||||
//是否所有标签都行内显示
|
||||
"inline": false,
|
||||
//是否标签值在前
|
||||
"valueFirst": false,
|
||||
"label":
|
||||
//标签名样式,这里不必添加默认样式,因为图表元素已设置
|
||||
"name":
|
||||
{
|
||||
//标签名样式,这里不必添加默认样式,因为图表元素已设置
|
||||
"name":
|
||||
{
|
||||
"show": true
|
||||
},
|
||||
//标签值样式,这里不必添加默认样式,因为图表元素已设置
|
||||
"value":
|
||||
{
|
||||
}
|
||||
}
|
||||
"show": true
|
||||
},
|
||||
//标签值样式,这里不必添加默认样式,因为图表元素已设置
|
||||
"value": {}
|
||||
},
|
||||
options);
|
||||
|
||||
if(options.inline == true)
|
||||
labelWrapper.addClass("dg-chart-label-inline");
|
||||
|
||||
// < @deprecated 兼容2.7.0版本的{label:{name:{...},value:{...}}}配置项结构,未来版本会移除
|
||||
if(options.label && options.label.name)
|
||||
options.name = $.extend(true, {}, options.name, options.label.name);
|
||||
if(options.label && options.label.value)
|
||||
options.value = $.extend(true, {}, options.value, options.label.value);
|
||||
// > @deprecated 兼容2.7.0版本的{label:{name:{...},value:{...}}}配置项结构,未来版本会移除
|
||||
|
||||
chart.internal(labelWrapper[0]);
|
||||
};
|
||||
|
||||
|
@ -4719,7 +4726,7 @@
|
|||
var signNameMap = chartSupport.chartSignNameMap(chart);
|
||||
var renderOptions = chart.renderOptions();
|
||||
var valueFirst = renderOptions.valueFirst;
|
||||
var showName = renderOptions.label.name.show;
|
||||
var showName = (renderOptions.name && renderOptions.name.show);
|
||||
|
||||
var chartDataSets = chart.chartDataSetsMain();
|
||||
|
||||
|
@ -4798,12 +4805,16 @@
|
|||
if(valueFirst)
|
||||
{
|
||||
$labelValue = $("<div class='label-value'></div>").appendTo($label);
|
||||
chartFactory.setStyles($labelValue, renderOptions.label.value);
|
||||
|
||||
if(renderOptions.value)
|
||||
chartFactory.setStyles($labelValue, renderOptions.value);
|
||||
|
||||
if(showName)
|
||||
{
|
||||
$labelName = $("<div class='label-name'></div>").appendTo($label);
|
||||
chartFactory.setStyles($labelName, renderOptions.label.name);
|
||||
|
||||
if(renderOptions.name)
|
||||
chartFactory.setStyles($labelName, renderOptions.name);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4811,11 +4822,15 @@
|
|||
if(showName)
|
||||
{
|
||||
$labelName = $("<div class='label-name'></div>").appendTo($label);
|
||||
chartFactory.setStyles($labelName, renderOptions.label.name);
|
||||
|
||||
if(renderOptions.name)
|
||||
chartFactory.setStyles($labelName, renderOptions.name);
|
||||
}
|
||||
|
||||
$labelValue = $("<div class='label-value'></div>").appendTo($label);
|
||||
chartFactory.setStyles($labelValue, renderOptions.label.value);
|
||||
|
||||
if(renderOptions.value)
|
||||
chartFactory.setStyles($labelValue, renderOptions.value);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue