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 2021/09/28 10:41:53 UTC

[GitHub] [echarts] gehringf opened a new issue #15807: How to flip axis on customRender

gehringf opened a new issue #15807:
URL: https://github.com/apache/echarts/issues/15807


   ### Version
   5.2.1
   
   ### Reproduction link
   [https://codesandbox.io/s/echarts-custom-series-sygpx?file=/src/chart.ts](https://codesandbox.io/s/echarts-custom-series-sygpx?file=/src/chart.ts)
   
   ![image](https://user-images.githubusercontent.com/56080149/135072366-4d4e9cf6-d62a-4f12-a15b-dd7faef8e51d.png)
   
   
   ### Steps to reproduce
   I need the axis of this chart to be flipped, so time is on yAxis (later at the top, earlier at the bottom).
   
   I have given it several tries but I always end up with the calculated rect being undefined. I think I'm doing something wrong with the api.coord calculation. 
   
   Here's my latest attempt: https://codesandbox.io/s/echarts-custom-series-forked-qvqu2?file=/src/chart.ts
   
   Can you point me in the right direction?
   
   ### What is expected?
   The axis are flipped
   
   ### What is actually happening?
   I can't get it to work.
   
   ---
   Also, api.style() is still in the docs and works, but is deprecated in the package.
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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 #15807: How to flip axis on customRender

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






-- 
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 #15807: How to flip axis on customRender

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


   @gehringf Can you draw how you expect it to be?


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   I have different bars on the same category. They're all slices of time, describing e.g. working shifts (with startTime, duration, endTime...). 
   I've been able to pull it off with a custom series, when the time is on the xAxis, but now I need it on the yAxis and can't figure out how the calculations in the `renderItem` function work in this case.


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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






-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   @Ovilia Does the image 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] Ovilia commented on issue #15807: How to flip axis on customRender

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


   Using time axis with bar series won't help because the width of the bar are not in the unit of time. You can make it if you are using a custom series. 
   But it would be easier if you use stacked bar [like this](https://echarts.apache.org/examples/en/editor.html?c=bar-waterfall) but if you have different numbers of bars on different categories, maybe a custom series is still required.


-- 
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 #15807: How to flip axis on customRender

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


   Gantt chart can be mocked by using an invisible series like https://echarts.apache.org/examples/en/editor.html?c=bar-waterfall . Data zooming is supported in this case.


-- 
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] echarts-bot[bot] commented on issue #15807: How to flip axis on customRender

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15807:
URL: https://github.com/apache/echarts/issues/15807#issuecomment-929070446


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


-- 
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 #15807: How to flip axis on customRender

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


   I think the logic is very similar to https://echarts.apache.org/examples/en/editor.html?c=custom-profile If you have further questions, please provide the demo with what you can do can we will see what to 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] gehringf commented on issue #15807: How to flip axis on customRender

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


   YES! That's exactly what I needed. Thank you so much!
   
   I couldn't quite wrap my head around how `api.coord()` works exactly.
   
   The only question I have left is in regards to the border radius. The setting in items style doesn't do anything. Only the `shapeRect.r` seems to work but isn't typed correctly. Is `shapRect.r` still the way to go or is there another way. I think api.style has been deprecated‽ 
   
   


-- 
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] echarts-bot[bot] commented on issue #15807: How to flip axis on customRender

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15807:
URL: https://github.com/apache/echarts/issues/15807#issuecomment-929070446


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


-- 
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 #15807: How to flip axis on customRender

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


   @gehringf Sorry for late reply.
   
   Does this work for you?
   
   ```js
   option = {
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
     },
     yAxis: {
       type: 'value'
     },
     series: [
       {
         data: [120, 200, 150, 80, 70, 110, 130],
         type: 'bar',
         label: {
           show: true,
           rotate: 90
         }
       }
     ]
   };
   ```


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   I have different bars on the same category. They're all slices of time, describing e.g. working shifts (with startTime, duration, endTime...). 
   I've been able to pull it off with a custom series, when the time is on the xAxis, but now I need it on the yAxis and can't figure out how the calculations in the `renderItem` function work in this case.


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   Should've done this right away, sorry.
   
   ![image](https://user-images.githubusercontent.com/56080149/135237918-cd1b91d7-2d07-49d6-8f3a-8dcd02f8e1a2.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] gehringf closed issue #15807: How to flip axis on customRender

Posted by GitBox <gi...@apache.org>.
gehringf closed issue #15807:
URL: https://github.com/apache/echarts/issues/15807


   


-- 
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 #15807: How to flip axis on customRender

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


   Hi, you can set `xAxis.position` to be `'top'`.


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   Yes, that too, but I want time to flow vertically on the yAxis.
   I know how to change the axis themselves but then I can't get the data to be drawn correctly.
   
   (https://codesandbox.io/s/echarts-custom-series-forked-qvqu2?file=/src/chart.ts)


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   > @gehringf Sorry for late reply.
   > 
   > Does this work for you?
   > 
   > ```js
   > option = {
   >   xAxis: {
   >     type: 'category',
   >     data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
   >   },
   >   yAxis: {
   >     type: 'value'
   >   },
   >   series: [
   >     {
   >       data: [120, 200, 150, 80, 70, 110, 130],
   >       type: 'bar',
   >       label: {
   >         show: true,
   >         rotate: 90
   >       }
   >     }
   >   ]
   > };
   > ```
   
   @Ovilia this produces something very different 🤔 
   ![image](https://user-images.githubusercontent.com/56080149/136509617-10f21ad6-85d5-4486-b676-6b301da57c79.png)
   
   I'm looking to have a vertical(y) time axis, with the bars taking up a portion of that time (kinda like a gantt chart).
   At some point I might have to add datazoom to it. I've gotten it to work for a different chart where the time axis is on the xAxis, but I can't figure out how to do it for this one.
   


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   As I said, it works as long as time is on X. 
   
   Here's my attempt at switching the axis so time is on Y. 
   
   https://codesandbox.io/s/echarts-custom-series-forked-qvqu2?file=/src/chart.ts
   
   The topmost link in the original question is the same but with time on X. 
   
   


-- 
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 #15807: How to flip axis on customRender

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


   Using time axis with bar series won't help because the width of the bar are not in the unit of time. You can make it if you are using a custom series. 
   But it would be easier if you use stacked bar [like this](https://echarts.apache.org/examples/en/editor.html?c=bar-waterfall) but if you have different numbers of bars on different categories, maybe a custom series is still required.


-- 
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] gehringf commented on issue #15807: How to flip axis on customRender

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


   > Gantt chart can be mocked by using an invisible series like https://echarts.apache.org/examples/en/editor.html?c=bar-waterfall . Data zooming is supported in this case.
   
   I can't figure out how to align them into one bar so it looks like my drawing and use a time axis.
   
   ![image](https://user-images.githubusercontent.com/56080149/136797547-a054f462-2494-4eb9-9ca0-73bb095fdfc0.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