You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Covarians (via GitHub)" <gi...@apache.org> on 2023/08/21 15:17:55 UTC

[GitHub] [echarts] Covarians opened a new issue, #19024: YAxisId instead of YAxisIndex in series object

Covarians opened a new issue, #19024:
URL: https://github.com/apache/echarts/issues/19024

   ### What problem does this feature solve?
   
   We are using setOption with replaceMerge option to add /remove series and associated axis. The issue is that we do not control the index at which the series or axis will end up after the replaceMerge process. For exemple we realized that when you remove an axis Echarts leaves a holes in the option variable with undefined. The next time we add an axis Echart will use this hole for the new axis. So its index will not be the last axix index + 1 but will be the hole's index. This mecanism is not documented so there is no way to set a proper YAxisIndex.   
   
   ### What does the proposed API look like?
   
   This is why we propose to add YAxisId in the propoertires of series. The same for XAxis index and for GridIndex for XAxix.
   
   **In a more general way, references to elements in Echarts should be done by ids instead of indexes.**


-- 
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: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] helgasoft commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1688543238

   First, I agree 100% about a feature request to define yAxisId (or xAxisId) in series, would be useful.
   But here and now, we are looking for solutions to **present** problems. For instance _gridIndex_ and _replace_merge_elements_ are undefined, and I have no idea how many grids and series you want to add. If you expand your code to a real **Minimal Reproduction**, maybe we can find a workaround that works **today**.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] helgasoft commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1736769677

   link fixed


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] YAxisId instead of YAxisIndex in series object [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #19024: YAxisId instead of YAxisIndex in series object
URL: https://github.com/apache/echarts/issues/19024


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] helgasoft commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1687317361

   > The issue is that we do not control the index at which the series or axis will end up after the replaceMerge process.
   
   Why not? Find **axis** indexes from IDs, **series** are replaced by id already - [Demo Code](https://echarts.apache.org/examples/en/editor.html?c=bar-simple&code=B4Q2EsGcAIF5oNoChrQN4tdcATAXNAOQCMhANJqjiAC4gEKECyA9gHblEAqArgKadCAdT45BXABY9BAMQBO4QQGVaynhwC6FLNDBQAMiABGfADYE0AM3Y0R4AOYSaBQkZamxAX0yft6Stj4RKR-VLT0iIQAUiAcZEQyfEaCTCBygiCCkIL2ghKEWgF6kIYm5ujWbLZ8Dk4ubh6E3qjeGgDcSJB8Cnww8MioGDq4Ltmh0DQAngAOfPVp5AHUdAzEAEwADPGbW9DEAKy7ABy7AOy7xMQXAMwbGj5-Q1gjRGMBU7MupuBsAuOQkwAtg0lOAAF5zaBrNbjZYRBDrbYXXa3eKHeJXeK3e4tJDtJAsaY0cDsOD-VDEmimSFoCZ8YDOIgAY2-TIA1tAmRI0jQJixoIDuvY-LpgL0APRdHrZaC-TDAACCEEgDACtJehDWnDhDEIIH1giMRqykDGREy8UIZsIuUt-Q0svGoGVCDufkKqEmSqgFjlqCl4F6qp0T2GQUITPYkBoix0FJmkKtTNoNG6sbjAOB7lBEIIxCO4zCK0QML2u02SMr0AALCi7gE_VgA71XR7oPdPB0aPZTGTLCBTF0OoDJgBhblyGgAOnYAAoI6y2ZxLOomcTSbO-AA3PhVACU5MCwDJhPXbCniuVU8sPxwAEk2Dh6bPNwfYAA-dDQOR8Gg8ORsNAfBTrgcDwCQhBtLKe4dKg4CWNAs7dqYB6htAp4kuel5QAguDAA68DOjhdywVgGHsFOzZ9IgVGtviLRAYOIpoeRWHepAuE4PhZJERxxD0WRRKYZR3SBtRCC0fxAnNBMPZkgAhMhpEju
 OPIiTQADyQlzqxMFIJ4MFAA)
   NB: please close issue if problem solved.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] YAxisId instead of YAxisIndex in series object [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-3340519907

   This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Covarians commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "Covarians (via GitHub)" <gi...@apache.org>.
Covarians commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1688574031

   Thank you very much for your response.
   For completeness  would need to to get :
   
   - gridId instead of gridIndex in xAxis properties
   - gridId instead of gridIndex in yAxis properties
   - yAxisId instead of yAxisIndex in Series properties
   - xAxisId instead of xAxisIndex in Series properties
   
   For the time being we guess the way Echarts sets the indexes of grids and axis indexes following the hereunder rules:
   - when an element is deleted it's position in the array is set to undefined and the other positions are unchanged
   - when a new element is created it will use the first position containing 'undefined'
   
   It seems to work. Be we would be pleased to know if these rules are exact and if there are or not other rules.
   
   Regards.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Covarians commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "Covarians (via GitHub)" <gi...@apache.org>.
Covarians commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1688048217

   Hello,
   Thanks for your answer. I undesrtood the sample code but our case is a litte bit different so let me explain better.
   If we want to add a new serie to a graph we need first to create the Yaxis then to create the Series and reference the series to the YAxisIndex parameters.
   Using the setOption with replaceMerge option the code would be the following:
   ```
   option = {
       yAxis : []
       series : []
   }
   
   // Add new Y axis
   option.yAxis.push({
   		id: newSerieId,
   		position: "left",
   		type: "value",
   		gridIndex: gridIndex,
   		triggerEvent: true
   	});
   
   // Add new series.
   option.series.push({
   		id: newSerieId,
   		encode: {
   			x: "datetimes",
   			y: serie.name
   		},
   		seriesLayoutBy: "row",
   		name: serie.name,
   		xAxisIndex: gridIndex,
   		yAxisIndex: HOW DO I GUESS THE INDEX ?
   		// ...
   	});
   chart.setOption(option, { replaceMerge: replace_merge_elements });
   ```
   So you see here the problem we are facing : We need to know before its creation the Yaxis  index at which the YAxis will be positionned by Echarts. And we do not know how Echart will decide it.
   
   So it would be much simpler to define yAxisId instead of yAxisIndex in the option object !
   
   This would also improve the architecture of Echart : Ids on the application side, Indexes hidden in the realm of Echarts code.
   
   Thanks for your help.
   
   
   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Covarians commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "Covarians (via GitHub)" <gi...@apache.org>.
Covarians commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1736763207

   The link does not seem to work.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] YAxisId instead of YAxisIndex in series object [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-3368539317

   This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] helgasoft commented on issue #19024: YAxisId instead of YAxisIndex in series object

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1736748461

   > - when an element is deleted it's position in the array is set to undefined and the other positions are unchanged
   > - when a new element is created it will use the first position containing 'undefined'
   It seems to work.
   
   No way to know how it works for you without sample code...
   We see the exact **opposite** happening - series and axes positions are changing on delete and added elements are appended.
   
   [Demo Code]() - follow title instructions to test.
   The example shows how to add/delete **pairs** of axis/series using only _seriesIndex_ and _seriesName_. 
   Please close issue if solution is satisfactory.
   
   ![image](https://github.com/apache/echarts/assets/13038071/91721446-e295-43a0-8e54-52b567a3e1b8)
   
   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org