apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.49k stars 19.61k forks source link

Label not rendering correctly in Gantt Chart inside the bars #15289

Open githubdatabridge opened 3 years ago

githubdatabridge commented 3 years ago

Version

5.1.0

Reproduction link

https://jsfiddle.net/3nwsdjxf/199/

Steps to reproduce

When rendering the gantt chart the rendering of the label within the bars is failing. This happens in SVG and CANVAS mode. There is no duplication of data. Example provided in the fiddler demo.

What is expected?

Labels are rendered correctly within the bars

What is actually happening?

Labels rendering within the bar is not rendered correctly.


Additionally is there a way to disable the zooming on the scrolling (slider), so that we can achieve just the scrolling behaviour without the zooming?

echarts-bot[bot] commented 3 years ago

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 and chart option 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 our mailing list.

Have a nice day! 🍵

Ovilia commented 3 years ago

Please simplify your demo to be minimum.

githubdatabridge commented 3 years ago

Hi @Ovilia,

I have simplified the demo. Please just say me if this is enough.

Just noticed in case we have for the same Dimension more than one event, the Label is not rendered correctly, even though the event happens in different times, I printed in the console log the rect of the text value with the coordinates.

I have updated the fiddler link above with the new simplified version

Ovilia commented 3 years ago

Text x is _rawData.colStartAtPx[0] which is 0 so the text all have the same position. Please refer to this example.

githubdatabridge commented 2 years ago

Hi @Ovilia ,

I believe that the _rawData.colStartAtPx[0] is related to the label of the column, as when I am changing it it shifts the label to left or right according to that value.

But in our case the issue is that we would like to avoid the overlapping of the labels within the rect, as you from the screenshot above.

The related piece of code is in line 227, even though x and y are always different it renders at

position x=0 (see screenshot below):

var rectText = clipRectByRect(params, { x: x, y: y, width: barLength, height: barHeight, });

Screenshot 2022-10-11 090716

Hope this helps.

Kind regards, Patric

githubdatabridge commented 2 years ago

@Ovilia any update on this?

github-actions[bot] commented 2 days ago

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.