|
|
@@ -61,8 +61,8 @@ function barOption(data, barConfig, themeConfig, styleConfig) {
|
|
|
const { barMaxWidth, barMinHeight, barGap, stack, labelVisible, labelPosition, labelDistance,
|
|
|
labelRotate, xNameLocation, xNameGap, xNameRotate, xLabelHiddenCover, xLabelRotate, dataZoomVisible,
|
|
|
xLabelMargin, yNameLocation, yNameGap, yNameRotate, labelZeroVisible } = styleConfig;
|
|
|
- let xTitle = xAxis?`${xAxis.column.label}${xAxis.granularity.value?'('+xAxis.granularity.label+')':''}`:null
|
|
|
- let yTitle = yAxis?`${yAxis.column.label}${yAxis.gauge.value?'('+yAxis.gauge.label+')':''}`:null
|
|
|
+ let xTitle = xAxis?`${xAxis.column.label}`:null
|
|
|
+ let yTitle = yAxis?`${yAxis.column.label}`:null
|
|
|
let legendVisible = !!groupBy && !!groupBy.key;
|
|
|
data.serieses = data.serieses || [];
|
|
|
|
|
|
@@ -71,6 +71,16 @@ function barOption(data, barConfig, themeConfig, styleConfig) {
|
|
|
trigger: "axis",
|
|
|
axisPointer: {
|
|
|
type: "cross"
|
|
|
+ // },
|
|
|
+ // formatter: function (params, ticket, callback) {
|
|
|
+ // var str = `${params[0].name}<br />`;
|
|
|
+ // params.forEach((p) => {
|
|
|
+ // const { marker, seriesName, value } = p;
|
|
|
+ // if(value !== undefined) {
|
|
|
+ // str += `${marker}${seriesName}: ${value}<br />`
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return str;
|
|
|
}
|
|
|
},
|
|
|
legend: {
|
|
|
@@ -114,10 +124,10 @@ function barOption(data, barConfig, themeConfig, styleConfig) {
|
|
|
}],
|
|
|
series: data.serieses.map(s => {
|
|
|
return {
|
|
|
- name: groupBy ? s.name : (yAxis.column.label || s.name),
|
|
|
+ name: !!groupBy && !!groupBy.key ? s.name : yAxis.column.label,
|
|
|
type: 'bar',
|
|
|
data: s.value.map(v => numberFormat(v)),
|
|
|
- barMaxWidth: barMaxWidth || 80,
|
|
|
+ barMaxWidth: barMaxWidth || 60,
|
|
|
barMinHeight: barMinHeight || 0,
|
|
|
barGap: barGap || '30%',
|
|
|
stack: !!groupBy && !!groupBy.key && !!stack,
|
|
|
@@ -206,7 +216,7 @@ function lineOption(data, lineConfig, themeConfig, styleConfig) {
|
|
|
}],
|
|
|
series: data.serieses.map(s => {
|
|
|
return {
|
|
|
- name: groupBy ? s.name : (yAxis.column.label || s.name),
|
|
|
+ name: !!groupBy && !!groupBy.key ? s.name : yAxis.column.label,
|
|
|
type: 'line',
|
|
|
data: s.value.map(v => numberFormat(v)),
|
|
|
stack: !!groupBy && !!groupBy.key && !!stack,
|