Atokulus commented on issue #20949:
URL: https://github.com/apache/echarts/issues/20949#issuecomment-2841684795

   Thanks @helgasoft  and @Yatekii for your fast feedback.
   
   Currently, I order the keys dynamically according to dataset length as a 
hotfix, which seems to be the easiest and most performant way (for larger 
datasets). In my setup using Vue-ECharts (I have a streaming, multi-axis, 
multi-plot chart with interactive zoom decimation/loading), this seems to work 
quite good.
   
   1. I do not see null filling as a satisfying hotfix, as it is adding 
additional workload.
   2. I do not see splitting the dataset into multiple pairs as a good solution 
either, as I now have to compute the datasetIndex for more complex scenarios 
(which I have):
   ```javascript
     option = {
       xAxis: { },
       yAxis: { },
       series: [
         {
           type: 'line',
           encode: {
             x: 'smallX',
             y: 'smallY',
           },
         },
         {
           type: 'line',
           encode: {
             x: 'largeX',
             y: 'largeY',
           },
           datasetIndex: 1 // Now we need to determine dataIndex, which is not 
easier.
         }
       ],
       dataset: [
         {
           source: {
             smallX: [10, 20, 30],
             smallY: [3.141, 7, 5]  
           }
         },
         {
           source: {
             largeX: [9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31],
             largeY: [1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15]
           }
         }
       ],
     };
   ```
   
   In the end, even if the behaviour is documented, it is
   * **Not intuitive** and therefore not to be anticipated by the user.
   * It is **hard to detect in the first place** (e.g. two datasets with 
similar, but not identical length). This is why I did not discover this issue 
early on in more complex charts.
   * On the surface, a fix might not be that hard to implement, as the correct 
ordering **already is working with sorted named datasets** (?).
   
   Best regards
   Markus
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to