Skip to content

Commit

Permalink
fix(chart): fix double y chart label and format issue running-elephan…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuiyansong committed Nov 11, 2021
1 parent 6c2e7a4 commit 67b73cb
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import {
getAxisTick,
getColumnRenderName,
getCustomSortableColumns,
getExtraSeriesDataFormat,
getExtraSeriesRowData,
getReference,
getSeriesTooltips4Rectangular,
getSplitLine,
Expand Down Expand Up @@ -190,6 +192,8 @@ class BasicDoubleYChart extends Chart {
sampling: 'average',
data: dataColumns.map(dc => ({
...config,
...getExtraSeriesRowData(dc),
...getExtraSeriesDataFormat(config?.format),
value: dc[getValueByColumnKey(config)],
})),
...this.getGraphStyle(graphType, graphStyle),
Expand Down Expand Up @@ -392,10 +396,10 @@ class BasicDoubleYChart extends Chart {
position,
...LabelFont,
formatter: params => {
const { name, value, data } = params;
const { value, data } = params;
const formattedValue = toFormattedValue(value, data.format);
const labels: string[] = [];
labels.push(`${name}: ${formattedValue}`);
labels.push(formattedValue);
return labels.join('\n');
},
},
Expand Down

0 comments on commit 67b73cb

Please sign in to comment.