Skip to content

Commit

Permalink
fix (LinePlot and StackedLinePlot): set floating point precision in t…
Browse files Browse the repository at this point in the history
…itle to 2 (#2270)
  • Loading branch information
khavinshankar committed May 12, 2022
1 parent c3fa937 commit 90d2ece
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const LinePlot = (props: any) => {
const { title, name, xData, yData, low = null, high = null } = props;
let generalOptions = {
title: {
text: `${title} [ {0|${yData[yData.length - 1] || "NA"}} ]`,
text: `${title} [ {0|${yData[yData.length - 1]?.toFixed(2) || "NA"}} ]`,
textStyle: {
fontSize: 20,
rich: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const StackedLinePlot = (props: any) => {
" [ " +
yData
.map(
(x: any, i: number) => `{${i}|${x.data[x.data.length - 1] ?? "NA"}}`
(x: any, i: number) =>
`{${i}|${x.data[x.data.length - 1]?.toFixed(2) ?? "NA"}}`
)
.join(" | ") +
" ] ",
Expand Down

0 comments on commit 90d2ece

Please sign in to comment.