Skip to content

Chart Y Axis auto scaling too agressive #1898

@Steve-Mcl

Description

@Steve-Mcl

Current Behavior

@colinl

I think the new auto scaling may be too aggressive?

Look at this demo when both are the same value, it auto scales to the point where the lowest bar is hidden.

Image

Expected Behavior

Unsure.

How did chartjs handle this?

How does echarts handle this by default?

Steps To Reproduce

[{"id":"a3d4b94547d8230a","type":"ui-chart","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"Time Bar Chart","label":"X - msg.topic, Series - msg.series","order":4,"chartType":"bar","category":"series","categoryType":"msg","xAxisLabel":"","xAxisProperty":"topic","xAxisPropertyType":"msg","xAxisType":"category","xAxisFormat":"","xAxisFormatType":"auto","xmin":"","xmax":"","yAxisLabel":"","yAxisProperty":"","yAxisPropertyType":"property","ymin":"","ymax":"","bins":"","action":"append","stackSeries":false,"pointShape":"circle","pointRadius":4,"showLegend":true,"removeOlder":1,"removeOlderUnit":"3600","removeOlderPoints":"","colors":["#37b067","#edb40e","#527ce0","#e26060","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"textColor":["#666666"],"textColorDefault":true,"gridColor":["#e5e5e5"],"gridColorDefault":true,"width":6,"height":8,"className":"","interpolation":"linear","x":800,"y":1240,"wires":[[]]},{"id":"dd772809337e4f4e","type":"change","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","name":"","rules":[{"t":"set","p":"series","pt":"msg","to":"Green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1160,"wires":[["a3d4b94547d8230a"]]},{"id":"c45592fb7b71a291","type":"change","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","name":"","rules":[{"t":"set","p":"series","pt":"msg","to":"Yellow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1200,"wires":[["a3d4b94547d8230a"]]},{"id":"0a2f1cb3352df76b","type":"change","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","name":"","rules":[{"t":"set","p":"series","pt":"msg","to":"Green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1280,"wires":[["a3d4b94547d8230a"]]},{"id":"13a0437e5275bc22","type":"change","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","name":"","rules":[{"t":"set","p":"series","pt":"msg","to":"Yellow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1320,"wires":[["a3d4b94547d8230a"]]},{"id":"ce36bef202fba49c","type":"ui-button","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"","label":"Clear Chart Data","order":9,"width":0,"height":0,"emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"[]","payloadType":"json","topic":"topic","topicType":"msg","buttonColor":"red","textColor":"white","iconColor":"","x":550,"y":1240,"wires":[["a3d4b94547d8230a"]]},{"id":"9bcb1ec98cd0b037","type":"ui-slider","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"Bar 1","label":"Slider 1 Green","tooltip":"","order":5,"width":0,"height":0,"passthru":false,"outs":"all","topic":"slider-1","topicType":"str","thumbLabel":"true","showTicks":"always","min":0,"max":10,"step":1,"className":"","iconPrepend":"","iconAppend":"","color":"#37b067","colorTrack":"#37b067","colorThumb":"#37b067","x":410,"y":1160,"wires":[["dd772809337e4f4e"]]},{"id":"468235da1077fccb","type":"ui-slider","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"Bar 2","label":"Slider 1 Yellow","tooltip":"","order":6,"width":0,"height":0,"passthru":false,"outs":"all","topic":"slider-1","topicType":"str","thumbLabel":"true","showTicks":"always","min":0,"max":10,"step":1,"className":"","iconPrepend":"","iconAppend":"","color":"#edb40e","colorTrack":"#edb40e","colorThumb":"#edb40e","x":410,"y":1200,"wires":[["c45592fb7b71a291"]]},{"id":"2a6e83a5e53d812d","type":"ui-slider","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"Bar 3","label":"Slider 2 Green","tooltip":"","order":7,"width":0,"height":0,"passthru":false,"outs":"all","topic":"slider-2","topicType":"str","thumbLabel":"true","showTicks":"always","min":0,"max":10,"step":1,"className":"","iconPrepend":"","iconAppend":"","color":"#37b067","colorTrack":"#37b067","colorThumb":"#37b067","x":410,"y":1280,"wires":[["0a2f1cb3352df76b"]]},{"id":"3b0dd553b8606c53","type":"ui-slider","z":"b508b2cf4781499a","g":"e4e54f940c26aa1d","group":"8599b71565f22abf","name":"Bar 4","label":"Slider 2 Yellow","tooltip":"","order":8,"width":0,"height":0,"passthru":false,"outs":"all","topic":"slider-2","topicType":"str","thumbLabel":"true","showTicks":"always","min":0,"max":10,"step":1,"className":"","iconPrepend":"","iconAppend":"","color":"#edb40e","colorTrack":"#edb40e","colorThumb":"#edb40e","x":410,"y":1320,"wires":[["13a0437e5275bc22"]]},{"id":"8599b71565f22abf","type":"ui-group","name":"Bar Chart Advanced","page":"39fae809f6f7fc7b","width":"6","height":"1","order":4,"showTitle":false,"className":"","visible":"true","disabled":"false"},{"id":"39fae809f6f7fc7b","type":"ui-page","name":"Charts","ui":"72c1e5a9ec204878","path":"/charts-example","icon":"chart-box-outline","layout":"notebook","theme":"5075a7d8e4947586","breakpoints":[{"name":"Default","px":0,"cols":3},{"name":"Tablet","px":576,"cols":6},{"name":"Small Desktop","px":768,"cols":9},{"name":"Desktop","px":1024,"cols":12}],"order":2,"className":"","visible":true,"disabled":false},{"id":"72c1e5a9ec204878","type":"ui-base","name":"FlowFuse Demo Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control","ui-chart","ui-audio"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":5,"showDisconnectNotification":true,"allowInstall":false},{"id":"5075a7d8e4947586","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}},{"id":"b7efd40c3fe2dd6f","type":"global-config","env":[],"modules":{"@flowfuse/node-red-dashboard":"1.29.0"}}]

Environment

  • Dashboard version:
  • Node-RED version:
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds looking at to decide what to do

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions