Skip to content

Commit

Permalink
Merge pull request #1259 from FlowFuse/1255-multi-line-chart-does-not…
Browse files Browse the repository at this point in the history
…-draw-line-for-first-point-on-additional-topics

Fixed: multi line chart does not draw line for first point on additional topics
  • Loading branch information
Steve-Mcl authored Sep 3, 2024
2 parents 3db5503 + a6251fc commit 9fefd92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/widgets/ui-chart/UIChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,12 @@ export default {
const radius = this.props.pointRadius ? this.props.pointRadius : 4
// ensure we have a datapoint for the relevant series
const data = Array(sLabels.length + 1).fill({})
const data = Array(sLabels.length).fill({})
if (xIndex === -1) {
data[xLabels.length] = datapoint
// Add the new x-value to xLabels
xLabels.push(datapoint.x)
// Assign the datapoint to the new index (last position)
data[xLabels.length - 1] = datapoint
} else {
data[xIndex] = datapoint
}
Expand Down

0 comments on commit 9fefd92

Please sign in to comment.