You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/07 11:48:15 UTC

[GitHub] [echarts] Shaq76 opened a new issue, #17178: [Bug] encode series option doesn't support customized data items

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

   ### Version
   
   5.3.2
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   ```let data = [
   	["X", "S1"],
   	["a", {value: 100, id: 1}],
   	["b", {value: 200, id: 7}],
   	["c", {value: 400, id: 9}]
   ];
   
   let optionBroken = {
   	dataset: { source: data },
   	xAxis: { type: 'category' }, yAxis: {},
   	series: [
   		{
   			type: 'line', label: { show: true },
   			encode: { x:0, y:1 }
   		}
   	]
   };
   
   optionWorking = {
   	xAxis: { type: 'category', data: ["a","b","c"] }, yAxis: {},
   	series: [
   		{
   			type: 'line', label: { show: true },
   			data: [{value: 100, id: 1},{value: 200, id: 7},{value: 400, id: 9}]
   		}
   	]
   };
   
   option = optionBroken;
   ```
   
   ### Current Behavior
   
   When you data bind via the 'data' option you are able to use complex object with a 'value' property.
   When you data bind via the 'encode' option these complex objects are no longer supported.
   
   Here is a picture of the documentation:
   ![image](https://user-images.githubusercontent.com/19664605/172371796-b86bd6bc-60e0-42fa-ae33-0a253e4b0381.png)
   
   
   ### Expected Behavior
   
   I can use the 'encode' option in preference to the 'data' option.
   
   ### Environment
   
   ```markdown
   - OS: Windows 10
   - Browser: Chrome
   ```
   
   
   ### Any additional comments?
   
   I wasn't sure if this was a bug or a feature request, it seems like a little of both.


-- 
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] Shaq76 commented on issue #17178: [Bug] encode series option doesn't support customized data items

Posted by GitBox <gi...@apache.org>.
Shaq76 commented on issue #17178:
URL: https://github.com/apache/echarts/issues/17178#issuecomment-1149619161

   Hi thanks @Ovilia, I think there's been a miscommunication. I'm trying to use Javascript objects in the data set, not custom series? Try my 2 demos and you'll see what I mean?


-- 
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] Ovilia commented on issue #17178: [Bug] encode series option doesn't support customized data items

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17178:
URL: https://github.com/apache/echarts/issues/17178#issuecomment-1149496772

   Custom series supports dataset. See [this demo](https://echarts.apache.org/examples/zh/editor.html?c=data-transform-sort-bar&code=PYBwLglsB2AEC8sDeAoWsAmBDMWDOApmAFywDaa6ylVmEAtgdHlM6WQOTRaMcA0sDlgDmBfoJAAnYADMCeFjHEc8AY2CSxAjtjBiAunxpU8wAK6TVBdsdqcAElmjcAFrADSkrGcLiALACM2gCi0MIQ0AQEkuIAzAF-2gBMAAwBAQC0KUkZAUkchrZUnABaLljAsACKEE7iqdoAKgRYqi7RcQCsQYKp6VmxWQEFRrR2HABS-PQRHl4-BIICnUnaALI-EKq10PUAHADsyWmZ2bl-I0XonAAyELA3BBBxR4LNre0xAkkBAJzH_TOAT2lzGxQ47iwkgANosAHIEMz0Jy7b6dEJhCJRL6wJKdWIA05-LL5Qpg64cACCGEkO1gAHFpAB98R_JotNodbQZZR9U6ZAIANlB5M4a1qsARSJR4gOPQ4oXCkS5sCF6N6JwGuV-IrBnAAQgA3lz0WAAMTMbTwcUF6022zqAnie0JJIySQuZNFHEccDWT0YzwEgteCsxypxsUFto1gMGeQKRX0xgAvqMqKgwWAvMwZBp6KRM-SwABPEDWQSmSRgfhXWDqaAyCDCQt0RjMVikFTqTTiDQYaJdgdqDiwFNFce0SewL0AD0ps4geELxlL5a7qhwBGEGhLtdoWEXeBuWAARgRoa2InpJAA3LCX2ApATSXB6UixFJjyhpyglhdLoWv7oIQtLyCutBrhWHCqD4YDAPQ-5UEw6gDq2s5dtwvACCWXZqBoYhjum6CaNAA6SAAknoBawDIZjQKokAwLAAAUIBQjweACFgIAQAAlNQ5KwPekiwLOABqD5mIsiA8RAAB097QtJLEpHxADcdYibALjNi4AAKwDXggsByfJ6j9i
 xZASVJBDcbxim2SxAR8foGlaVCsDQsAADuhnGbJDkWZIGBWTZyl2aZDlKSpSSue5QnaeU0IyAA6hAGBgG4gUKSwABeBBWT0KRuWQJWwAAVE-8kBJpiWeXgpawiZZmNSWsIsUWQmNdIADWFZmbeS5mA-LEwcA3kxHxxHkk20KPvRA5NpEGB1imCXkpoYAWHAXXFmW0HCNIZggEhQltBA0I0kwNhCbQe13bAUFdtCWJnY9T05iwTHQOwKjlOWuofXgAMVg9H2zgEpC6cIBlGdAYBlfosAZDpD5pRlWUzR9sAllDOl6f5CNkAEXo4-gs5JNDhPw4j5UANRoyl6WZS42MfSWVME7DROI6TdZgsB5NtbCpAiwQAtUNOQnJkJKZ1WMQvoLo-BEBRZEEBhqo_ig8tAA).


-- 
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] christlee1989 commented on issue #17178: [Bug] encode series option doesn't support customized data items

Posted by GitBox <gi...@apache.org>.
christlee1989 commented on issue #17178:
URL: https://github.com/apache/echarts/issues/17178#issuecomment-1160045683

   +1 same


-- 
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] Ovilia commented on issue #17178: [Bug] encode series option doesn't support customized data items

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17178:
URL: https://github.com/apache/echarts/issues/17178#issuecomment-1149688531

   Sorry that I didn't look carefully enough.
   
   The correct way to use dataset is like:
   
   ```ts
   let data = [
   	["X", "value", 'id'],
   	["a", 100, 1],
   	["b", 200, 7],
   	["c", 400, 9]
   ];
   
   option = {
   	dataset: { source: data },
   	xAxis: { type: 'category' }, yAxis: {},
   	series: [
   		{
   			type: 'line', label: { show: true },
   			encode: { x:0, y:1 }
   		}
   	]
   };
   ```


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