kz930 opened a new issue, #7974:
URL: https://github.com/apache/texera/issues/7974

   ### What happened?
   
   The Waterfall Chart operator marks the last row of the input as the chart's 
total bar
   (`measure=["relative"] * (len(y_values) - 1) + ["total"]`). Plotly draws a 
total bar at
   the accumulated sum of the preceding bars and ignores the value supplied for 
it, so the
   last row's value is silently excluded from the chart while its data label 
still shows
   that value.
   
   Minimal case, four rows with values 1, 2, 3, 4. The final bar is drawn at 6, 
which is
   1+2+3, and is labelled `+4`. The correct total for the four rows is 10, and 
the value 4
   appears in no bar.
   
   On a fifteen-row table whose values sum to 45.7 with a last row of 3.3, the 
final bar is
   drawn at 42.4 and labelled `+3.3`:
   
   <img width="1090" height="1002" alt="Waterfall chart whose final bar is 
drawn at 42.4 but labelled +3.3" 
src="https://github.com/user-attachments/assets/efa84965-432f-4738-9b61-48123b263ec0";
 />
   
   Nothing in the operator asks for a summary row. The two fields are described 
as
   "categories or stages" and "numeric values for each stage", and there is no 
option
   controlling whether a total is drawn, so a plain detail table produces a bar 
whose height
   and label disagree.
   
   A second consequence appears when the X column is numeric and not already 
sorted. Plotly
   orders a numeric axis by value while `measure` is positional, so the total 
bar is drawn
   wherever that row's X value falls, which can be the middle of the chart with 
ordinary
   increasing bars to the right of it.
   
   The same code is generated by both `generatePythonCode` and 
`generateStandaloneCode`, so
   the two agree with each other and the parity tests pass.
   
   ### How to reproduce?
   
   1. Build a workflow of CSV File Scan into Waterfall Chart.
   2. Use a four-row table with a numeric column holding 1, 2, 3, 4 and any 
column for the
      X axis.
   3. Set X Axis Values to the label column and Y Axis Values to the numeric 
column, then
      run.
   4. The last bar is drawn at 6 and labelled `+4`.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   2c2c0e503
   
   ### What browsers are you seeing the problem on?
   
   Chrome
   
   ### Relevant log output
   
   ```shell
   _No response_
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to