Add console logging to debug traffic graph issues
This commit is contained in:
parent
13ca70da40
commit
ae5b73c495
1 changed files with 6 additions and 2 deletions
|
|
@ -51,10 +51,12 @@ const SensorChart = {
|
|||
const canvas = this.el.querySelector('canvas')
|
||||
const ctx = canvas.getContext('2d')
|
||||
const unit = this.el.dataset.unit || '%'
|
||||
const autoScale = this.el.dataset.autoScale === 'true'
|
||||
const showZeroLine = this.el.dataset.showZeroLine === 'true'
|
||||
const autoScale = this.el.dataset.autoScale === 'true' || this.el.dataset.autoScale === true
|
||||
const showZeroLine = this.el.dataset.showZeroLine === 'true' || this.el.dataset.showZeroLine === true
|
||||
const chartType = unit === 'bps' ? 'bar' : 'line'
|
||||
|
||||
console.log('Chart config:', { unit, autoScale, showZeroLine, chartType, datasetsCount: data.datasets.length })
|
||||
|
||||
// Generate colors for each dataset
|
||||
const colors = [
|
||||
'rgb(59, 130, 246)', // blue
|
||||
|
|
@ -118,6 +120,8 @@ const SensorChart = {
|
|||
// Add 10% padding, ensure minimum of 1000 (1 Kbps)
|
||||
maxAbsValue = Math.max(maxAbsValue * 1.1, 1000)
|
||||
|
||||
console.log('Traffic graph scale:', { maxAbsValue, min: -maxAbsValue, max: maxAbsValue })
|
||||
|
||||
yAxisConfig = {
|
||||
min: -maxAbsValue,
|
||||
max: maxAbsValue,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue