You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "vipsunwei (via GitHub)" <gi...@apache.org> on 2023/05/09 07:05:06 UTC

[GitHub] [echarts] vipsunwei opened a new issue, #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   ### Version
   
   5.4.2
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?c=line-simple&lang=ts&version=5.4.2&theme=dark&code=C4TwDgpgBAyhBOBLCBnA8mYiD2A7KAvFBAMYAWAhvMCgHRxKoZZ4DcAUKJFABoCCPRCgDC2ALZg8EXMGY58RUpWp1-gkeMm5pszPI7Y9eQlADe7KFABGFEgGsA5vGwBXXABNRAG2zwAXFAA5ADEAIzhgQA0FlBOiO4BptbYwMDiAQDMAAxQAL7Rll4QDtIJZjGW7hTAFAEA2oGA0XKAb3JRQYCUdoBlem2BgCw2gPOJgQC6BZZQwBAAHsAwoEWJFWMAZngziABeEAGhAGyjY1Ak2D7-QcFLF5eBi7kx-TFpx1hgCwcoZNgA7gHA8C4QiwA9ICoCt4GJqhNTks3CQWPgABRgKgUMQoACU5QOwLGR1wKGAUDciEJRGR8FRdBQCGQKAAcqjoARmR1ulAAPxBAANgSgAXJlNo1MY9MZhBZfUGHKCYi8vICgWu2JBlngEGALng-AFaKFNNQDLE0AA1EEADxWeCAgB8vNNOrouDFpt5QSg9pRuoAbhQvP93W67UTcCSgSD7pYI1BJnxJkJ6otzAdLFwtkESNVir4QFFFpYKHGUAAZChWCBeRKHY6-BXnC68qMHAtCIuIbSVrxtiCzEDzMxVk614Q7YSjgBiDby-zGzZQABVEPZK-8vgElr7qVO81AqjUE8mxoCAFTRwAu8YAHU0AdsZQI-A7dDG4xEbsGIgWPxqB1RPb1MKn1-iBcwPJ0jQVAYoARWV0SA5NJBQEl5AVIolmAGCDhAiA5ymGY5jTJIjkHM4ri3A9ZxLMsK37AiayI-sSOTFAwE7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lKRLOiE6JkTYlQDOvEi6Okzp3RCbtJJITElZ
 J8VWfEhJyEKKIHUVShTMlnUydkGJmSdiZIyakzJClMlpNCBMyJ2S2kuErhMeeCJ664B9iApu4wI5tyTp3LO988iMLNuErIWRGFAA
   
   ### Steps to Reproduce
   
   import * as echarts from 'echarts';
   
   type EChartsOption = echarts.EChartsOption;
   
   var chartDom = document.getElementById('main')!;
   var myChart = echarts.init(chartDom, 'dark');
   var option: EChartsOption;
   
   type SeriesOption = echarts.SeriesOption;
   type XAXisComponentOption = echarts.XAXisComponentOption;
   option = {
     backgroundColor: '#111',
     grid: { bottom: 30 },
     legend: {
       data: ['事件', '温度', '水量'],
       textStyle: {
         fontSize: 16,
         color: '#ffffff'
       }
     },
     tooltip: {
       show: true
       // formatter: function (params) {
       //   const unit = params.seriesName === '温度' ? '°' : params.seriesName === '水量' ? 'ml' : ''
       //   return params.seriesName + '<br/>' + params.name + '  ' + params.value + ' ' + unit
       // },
     },
     xAxis: [
       {
         type: 'category',
         axisLabel: { color: '#fff' },
         axisLine: { lineStyle: { color: '#C6CCCF' } },
         axisTick: { show: false },
         data: [
           /* x轴数据 */
         ]
       }
     ],
   
     yAxis: [
       {
         type: 'value',
         name: '水量 (ml)',
         position: 'left',
         nameTextStyle: { color: '#fff' },
         axisLabel: { color: '#fff' },
         splitLine: {
           show: true,
           lineStyle: { color: 'rgba(77,91,107,0.9)', type: 'dashed' }
         },
         axisLine: { show: true, lineStyle: { color: '#fff' } }
       },
       {
         type: 'value',
         name: '温度 (°)',
         position: 'right',
         nameTextStyle: { color: '#fff' },
         axisLabel: { color: '#fff' },
         splitLine: { show: false },
         axisLine: { show: true, lineStyle: { color: '#fff' } }
       }
     ],
     series: [
       {
         name: '事件',
         type: 'bar',
         barWidth: 9,
         itemStyle: {
           color: '#27B6D8'
         },
         data: [
           /* 事件数据 */
         ]
       },
       {
         name: '温度',
         type: 'line',
         symbolSize: 7,
         itemStyle: {
           color: '#AA4425'
         },
         yAxisIndex: 1,
         data: [
           /* 温度数据 */
         ]
       },
       {
         name: '水量',
         type: 'line',
         symbolSize: 7,
         itemStyle: {
           color: '#0680F1'
         },
         data: [
           /* 水量数据 */
         ]
       }
     ]
   };
   
   interface UpdateChartParam {
     incident: number[];
     temp: number[];
     water: number[];
     monthArr: string[];
   }
   
   const updateChart = ({ incident, temp, water, monthArr }: UpdateChartParam) => {
     if (myChart) {
       (option.xAxis as XAXisComponentOption[])[0].data = monthArr;
       (option.series as SeriesOption[])[0].data = incident;
       (option.series as SeriesOption[])[1].data = temp;
       (option.series as SeriesOption[])[2].data = water;
       myChart.setOption(option);
     }
   };
   // 模拟数据更新
   setTimeout(() => {
     const monthArr = [
       '1月',
       '2月',
       '3月',
       '4月',
       '5月',
       '6月',
       '7月',
       '8月',
       '9月',
       '10月',
       '11月',
       '12月'
     ];
     const incident = [10, 110, 10, 13, 14, 16, 17, 180, 10, 180, 70, 150];
     const temp = [10, 11, 12, 13, 14, 26, 27, 28, 19, 18, 17, 15];
     const water = [100, 110, 120, 130, 140, 160, 170, 180, 190, 180, 170, 150];
     updateChart({ incident, temp, water, monthArr });
   }, 1000);
   
   option && myChart.setOption(option);
   
   
   ### Current Behavior
   
   Property 'data' does not exist on type 'XAXisOption'.
     Property 'data' does not exist on type 'ValueAxisBaseOption & { gridIndex?: number; gridId?: string; position?: CartesianAxisPosition; offset?: number; categorySortInfo?: OrdinalSortInfo; } & { ...; }'.(2339)
   
   ### Expected Behavior
   
   I hope that TypeScript checks can pass without errors and the project can be packaged normally
   
   ### Environment
   
   ```markdown
   - OS:macOS 13.3.1 (a) (22E772610a)
   - Browser: chrome
   - Framework: typescript@5.0.4 echarts@5.4.2 vue@3
   ```
   
   
   ### Any additional comments?
   
   _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: 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] sjcobb commented on issue #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   +1 I've noticed this issue before, also it might be nice to rename the `XAXisOption` and `YAXisOption` types as part of this fix to `XAxisOption` and `YAxisOption` to fix the typos


-- 
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] vipsunwei commented on issue #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   
   ![image](https://user-images.githubusercontent.com/15810277/237025807-b6850ce7-5600-4ded-a8e6-9f5349c544e3.png)
   


-- 
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] vipsunwei commented on issue #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   > "XAXisOption" is not part of ECharts. The rest works fine. Pretty chart 😁 [Demo Code](https://echarts.apache.org/examples/en/editor.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oYDjT4k0wDN34QL-JgcItdG9f1fhSCAW3oDt02zQd834SdRhnVGTQzGNxQ1XVeV7WAADy4BTayt2clt2LxSgAD0UOwIAhFaAPtGgAOpoAdsaAC9mgANpigCJgGCTJkGArKssV8BlagSUpbAg3QEhI1EL1AEsBwgAQ5gsLD4azfAsLInMoCwim8ywqmC6kgt-oL5GC0GgvhjLLNsxwHNFB4CUU6lq3rTTDPhvGXDyLr-uwBwsi64puvpEbgZGwFBu6zbsB-obHCqZ1qswJTF0gNrTuhkb-G6ybRtm7A-EW4R8b4eRuuodbutW87KsoGrsDvX49OIEd8g-07-FOwoptO6kTuO3bTtBk79scCXRsu4n6WZT9hOiBrFAbfGnvxqn37xtTtOjcoYOxQbWdg0AA)
   
   When I was writing echarts chart code using TS, a type error was reported. Here is the code.
   [demo code](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&lang=ts&version=5.4.2&theme=dark&code=C4TwDgpgBAyhBOBLCBnA8mYiD2A7KAvFBAMYAWAhvMCgHRxKoZZ4DcAUKJFABoCCPRCgDC2ALZg8EXMGY58RUpWp1-gkeMm5pszPI7Y9eQlADe7KFABGFEgGsA5vGwBXXABNRAG2zwAXFAA5ADEAIzhgQA0FlBOiO4BptbYwMDiAQDMAAxQAL7Rll4QDtIJZjGW7hTAFAEA2oGA0XKAb3JRQYCUdoBlem2BgCw2gPOJgQC6BZZQwBAAHsAwoEWJFWMAZngziABeEAGhAGyjY1Ak2D7-QcFLF5eBi7kx-TFpx1hgCwcoZNgA7gHA8C4QiwA9ICoCt4GJqhNTks3CQWPgABRgKgUMQoACU5QOwLGR1wKGAUDciEJRGR8FRdBQCGQKAAcqjoARmR1ulAAPxBAANgSgAXJlNo1MY9MZhBZfUGHKCYi8vICgWu2JBlngEGALng-AFaKFNNQDLE0AA1EEADxWeCAgB8vNNOrouDFpt5QSg9pRuoAbhQvP93W67UTcCSgSD7pYI1BJnxJkJ6otzAdLFwtkESNVir4QFFFpYKHGUAAZChWCBeRKHY6-BXnC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8JMHyHRPHW45t2A4kAIRWgB9oyvIAF7NAANpuwakwAFxGlcMABECJx6Tz8mXQkt8e7wBMNrMYgRQiAAhzEKgQzrqOnIEDI2jFiBDxvog4gQibGOUTscxlhAgySsUEO6djAgKUcapFxaiNGhC0Y9dOlgZFQGAToRRqkdLhCyCEsJUBQgZBCXjEJexInyUiUrcJITklQBkhE0IRML7xz8WgoJmTlKRLOiE6JkTYlQDOvEi6Okzp
 3RCbtJJITElZJ8VWfEhJyEKKIHUVShTMlnUydkGJmSdiZIyakzJClMlpNCBMyJ2S2kuErhMeeCJ664B9iApu4wI5tyTp3LO988iMLNuErIWRGFAA)
   
   The location of the error is shown in the screenshot below, marked with a red arrow.
   
   ![image](https://github.com/apache/echarts/assets/15810277/b49e1817-1527-4c6f-8f4c-360bda89565b)
   


-- 
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] vipsunwei commented on issue #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   > oops, sorry, never used TS, now I see it's real. But why is the chart showing the correct _xAxis_ despite the error ? Someone else needs to answer that...
   
   In my vue@3+vite@4 project, packaging is required when the development is completed for deployment, and when I execute this ["vue-tsc && vite build"] packaging command, vue-tsc checks for this type error and terminates my packaging command
   
   
   ```
   > vue-tsc && vite build
   
   src/components/monitor/ReportIncident.vue:124:50 - error TS2339: Property 'data' does not exist on type 'XAXisOption'.
     Property 'data' does not exist on type 'ValueAxisBaseOption & { gridIndex?: number | undefined; gridId?: string | undefined; position?: CartesianAxisPosition | undefined; offset?: number | undefined; categorySortInfo?: OrdinalSortInfo | undefined; } & { ...; }'.
   
   124     ;(option.xAxis as XAXisComponentOption[])[0].data = monthArr
                                                        ~~~~
   
   
   Found 1 error in src/components/monitor/ReportIncident.vue:124
   
    ELIFECYCLE  Command failed with exit code 2.
   ```
   
   
   I created a small reproduction project, here is the GitHub address
   [echarts-typescript-error-demo](https://github.com/vipsunwei/echarts-typescript-error-demo)
   
   steps:
   1. pnpm install
   2. pnpm build


-- 
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 #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   oops, sorry, never used TS, now I see it's real. 
   But why is the chart showing the correct _xAxis_ despite the error ? Someone else needs to answer that...


-- 
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 #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   Error says "packager" is looking for [ValueAxisBaseOption](https://github.com/apache/echarts/blob/8b0877344f7d48f52d8256e777f9403c25c4513b/src/coord/axisCommonTypes.ts#L146) which indeed does not have _data_ property. 
   But xAxis[0] is in fact defined as _category_, and _CategoryAxisBaseOption_ has _data_ property. 
   That is the problem. Why it happens ? Have no idea.
   
   Workaround is to define _xAxis_ **in advance** - [Demo Code](https://echarts.apache.org/examples/en/editor.html?c=line-simple&lang=ts&version=5.4.2&theme=dark&code=C4TwDgpgBAyhBOBLCBnA8mYiD2A7KAvFBAMYAWAhvMCgHRxKoZZ4DcAUKJFABoCCPRCgDC2ALZg8EXMGY58RUpWp1-gkeMm5pszPI4k8KYFDF5gZPvHiEoAbXZQnUAOQBGQBDmLgDSPnLgCYvX2dXAGZgvycXABZI0JcAVnj_ADYU6IB2DNcADhyXAE4CtwAGEs8fKNc3IJc_AF0ObD08WwBvPwAjChIAawBzeGwAV1wAE1EAG2x4AC5XAGI3FaqnIcRxhfaoLuxgYHEFsNKoAF8QqCmIAektqE7Q8YpgCgW7F0BouUA3uR9XQEo7QBlen8XIAWG0A84kuBqXJzACAAD2AMFA1221ScADNzDBEAAvCALNypGHOQwzeZLDFU6n1UJnPwXPyHbBTLBgNGhFBkbAAdwWwHgIwgDMu8L48KE72qj1CUC4BNcJBeN1mIDWsooEpQABkKF0IFNtlAybMFi5FjTziSnJqhNrENojVMHRBkSBUQ9jSzTUthKlhAGAGIuc5W9FQW0oAAqiH6Rq5vIWGIoUxQ0EZsqgz1eCzMMks1mq9Kc0PYfhA4sl9ml4flZoAbimherQrgKGIFWDwVAABRiKYAShbzkkKEQLFwZuuGOAw6cbY7UYRSJRCp2Jop5stGY1Wt1-sNno3ZotVJDO85YGdwHtjoe4acCb5csFEGtzmd2jdHvX3s38AGHoe0yTJvEKNxvDKUDSloQoh28OVwE7Z4uQgcZz3DC9nEjW81ygJ9-VfBDP1dVcjWPSkz1DYtnCwmVQjrVxGymZt3wXTsgV7AAG-Dw1Hcd5DNJABjIWc2PbCAl0Rb88Io
 rcqKwm09z1A1yL_E9t3fFAr3HXD425Z9k1TdN3xwl19MTF8hWIl0ZLU8kNIU84i0aS400YFApVCejnHYs0fjnRDIDNHp4EC0KAHVNgsBZCnfccIDEOz70zJw5MWAJMgAIVSAARXJaVlRSsxeN5q1SqAAHoACooB-QAHU0AO2MoGqyrwwaIsSR8-cJLNIFAsYlwSMClAQDEPYphxfEFlA8MEqSsiUtS9K-D4GIYgCRJCrpd8Ky1ABJCYEUJd9szKhwKpqqAgSalq2szDqdprTM_NcCEBqQqcXRGsaJqmhVZszebku60l1KWUpUlyUpAzcbbaNO0qvNSq6IVu1r2pckt2DODh2AdOF4GTEhoAAVTAbMIGEZRgAABSodslodEhNh0BZcBGcaEDsJomUS9koA5rn4B5jgnB5ZUKSF_URd5pw8wsKwKWMJBcAGUWcbLQxcGMKARgp5VqaoEwiB7HZmdZmQELhCQEIlwmEIVgsbDOBZycpo3qHp-B2wHQgAD4mYxXsxBAT3gD9nzKsqnsWgnWgxS1CMUF4AQhFECQpBkOQ8B5gc7FKBpaDO2wnaVsXnFj1pcFodzkBTigU4Yeuc9wPOC6LkuiAt8YdArpwq_juvUGT2AEBb6v27cTvStsG2wH73s4_kWvx5Hxux481v24CGfXlse2EEX0Pw9X3QJ0H-QBwr-lcfYaOoEAQitAH2jJrABezQAG03YNNgBjDtRmAD2HsfsCCBxlNrXWPcdC2DsGUBCKxSjwMQVANwYR4ExHgcSFBoEUHQyQfAvBUBMjILcIkQuFcIEmHnjAuBKCIIoICPAtBKCMFQACFgzKCEAi5HgXFXB8CcGkLll6HWJhD42CILA0oJDaG1BIScdBJDUgkOIQQkhhQSGELcKolBZDhH6w9jTM2UAoFWzlPzO2ktHbmGduca-OMkHSOvkAA)


-- 
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 #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   "XAXisOption" is not part of ECharts.
   The rest works fine. Pretty chart 😁 
   [Demo Code](https://echarts.apache.org/examples/en/editor.html?c=graphgl-npm-dep&gl=1&theme=dark&code=PYBwLglsB2AEC8sDeAoWsBGBDAxgawHMAnYAV2gBMBhYAG2CIC5YByAYgEYuWAaNWYhArMkmYGDDAAtswDMABlgBfPuloBTAusoj-6CljBZmAbRaBouUBvcr1aBKO0BlejZaAWG0DziSwC6q9LDDqAHmAAymAAnhq6Pj4AZjDBEABe6swcAGzeUTh0DMzs0fkFLHrK_Cr8knSQIJE-AM4AFsAA7sxgRKTqpd7-AIL-ELWmxahR6GEgyaw4hpoMobzF6Fj9tQAyWBjqtCKwWfRMrGyFyhk-ywOrENCTorRX6iHhN7vZB-xUqVRfAGIsyieLWDnWoAFQg-B2DWazGiWFotXUANGsAMRlMsA8xSU_C8KH4oT6AyGURGo3GkxYADc4R0FsjoFgpBS3LAABRSWgASjpoxAwFqEEgMFyGmiYB5UQZTJBAWCYQiyBe-1yR3yfzKyOB60220Vexyh2OGtGtRAdzAl2uNWRUJavna6lOUTu10eCtE-reRAI2FZAHY_TwAJwcHgceSB-QAOiD3J4vlCE1yBga6go6sBxqiWvukMadraHXjLoe8uenpVRpKUSzyEB5Ny1NotKdsClFIcbIADXHAXyBULoLkiBACPVxa32zLAm7y69K2qkaMtRstjsK4bF7X0KbzZbnraYXCEUvsyt93nofai7AS7P1_PN9F1dWfNj0Lid-oR-pBrATMMgLtrkVgSj4DasNgRBgegUEAOpCGA9TMEGraCuoUj3nWyLoBu7AAEx-gAQqkAAiAAcRTItuKKGMY_6YjWpykpKjIdo4rYQSwJYwbAtShFIGB0EEiSTIGgLoZhZbWqMeFsD0PQACyKfhACsVGjDRBIrAAkpQAQpK2qL0SYjFvsxQFsbkbi8VxPGtvxgnCa
 JzDiciklYSxsmPuw8ipOR8jfBwGlMYCxmmGZ6DvhiKBKAA3HiWTQLUYCwKQICouoVD1FgRCpYgrIgJyCAAHzYbAEDRGyUihNluVgMVXmgIOUa9CsJjyB4UbGQgsAgFGUhxPUPREEQCVRM1UDQFGCI_rUHVdT1iD9VcOBCNoYDjT4k0wDN34QL-JgcItdG9f1fhSCAW3oDt02zQd834SdRhnVGTQzGNxQ1XVeV7WAADy4BTayt2clt2LxSgAD0UOwIAhFaAPtGgAOpoAdsaAC9mgANpigCJgGCTJkGArKssV8BlagSUpbAg3QEhI1EL1AEsBwgAQ5gsLD4azfAsLInMoCwim8ywqmC6kgt-oL5GC0GgvhjLLNsxwHNFB4CUU6lq3rTTDPhvGXDyLr-uwBwsi64puvpEbgZGwFBu6zbsB-obHCqZ1qswJTF0gNrTuhkb-G6ybRtm7A-EW4R8b4eRuuodbutW87KsoGrsDvX49OIEd8g-07-FOwoptO6kTuO3bTtBk79scCXRsu4n6WZT9hOiBrFAbfGnvxqn37xtTtOjcoYOxQbWdg0AA)


-- 
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] linghaoSu commented on issue #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   It looks like the union type is currently used for constraints, not just definitions, so when using it, since it doesn't all have a `data` field, it's best to bring a keyword that constrains the type, in this case `type`
   
   [<img width="499" alt="image" src="https://github.com/apache/echarts/assets/56526981/73062570-7218-42b9-b646-b98e931f59f8">](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&lang=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OoJMAZCBCJkWkhAYj1dRh4JecABMAkAEK7AAIgAHMqKY5XudS3juVhAgAVFArSAA6mgB2xlAt1Asetwzr1nn9WyE0uUEZkTSgIBiNYJwwJs6bCTuy2rRZ60pptoR8HwAAs6NbQArKdDmRVeRYAJKeNMOyRRd3WHndUDdC9b0fYeJ74_e75_VKAMjcEwORaD4OQ9DgSw4e8NrT9hwoyE2S7Ed2TjmEePjOdNSXXeNFQDTgz0-9n0OWe7B5AY7bQhuJDQAAqmAe4QMIyjAAACl61HtiQCQ6IEuCuODCD1MMHCpitrxRV75bwL7_tQF8WZnJ73th37sRiGsZB8PAZyEkguCOOHBsXvihLElbWa21QZI_skLtuzICmTBIClR9CClJzIKdp_kgSW9bJfUI7lJiFiBA2s7yw_mIIDd8AWI_fnRKxkWphGAitBz0IBiHIgI-IqnlIgLQQjbxQICIivmJTxeh4n_U2TDKY4vjLQD8n5Fw2QIqmaTI4OYTVUKuBM3c3b0ivZJWxBvBbjvoveQy9rwoFMPUO-VgH7QKLM_RSr8MxZk_vAXMqDKZQH_q3eAQDmZK3PuMREkC8D6lFFACgsCGB0jkHgX2GIr7DFoBdUwlcPA6AjlYChxhcDULpLQ-hBp0CCJYfUMI7DOFEFrmAPhP5KFCM6qgURsBxFMNwFIrasiVamAbggJRY8J76l0AiARCIMQRzuIbdguJACEVo
 AfaMXqABezQADabsBpMARcxo3DAERIiAeQ8nIz3wcnbecClhBDCIACHMPJBC2gkmcQRMgpJiejDJhwgjY2yeMIIux8lWCCAJYpwQjrlKCCJKpklanxMSWEZJp0E5WHCdwnQcDJIKQiNkHpfSoBhEyD09GPT9iDOEoM2W_SenTKgAJAZYRsbXwjuEhRXTFniUGVtHpwzBmjKgFtcZO0FJbSOj0xaUyemTKWa06sBIiRGPgBszZiytqLJyCMxZuxFkLNmYskSiy5lhD-YM5ZdzXBF0mBPREFdcCux4dXCYgd67RybpEtueQbEG36dkbINigA)
   


-- 
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 #18601: [Bug] Property 'data' does not exist on type 'XAXisOption'.

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

   ...but _xAxis.data_ is array already, so I tried only ```option.xAxis[0].data = monthArr;``` and it works.
   
   Also curious - why the need to define _xAxis_ **after** chart initialization? Why not set it in _option_ as in my Demo Code?


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