echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Space between bars.

Open geekboy0801 opened this issue 6 years ago β€’ 23 comments

Can't current version support to remove space between bars when some value is 0? https://ecomfe.github.io/echarts-examples/public/editor.html?c=dataset-series-layout-by&theme=light

screen shot 2019-02-10 at 9 45 15 am

geekboy0801 avatar Feb 10 '19 01:02 geekboy0801

image

In corner cases, we would get this chart.

geekboy0801 avatar Feb 10 '19 04:02 geekboy0801

This is not supported yet. We will have a further discussion about this feature.

Ovilia avatar Feb 12 '19 05:02 Ovilia

Thanks, @Ovilia, @100pah .

geekboy0801 avatar Feb 12 '19 16:02 geekboy0801

This should also apply to when the value is null. There can be instances where you would want a 0 value to be shown as well but null I guess should always be hidden.

TobiasSvenberg avatar Mar 22 '19 06:03 TobiasSvenberg

I need this exact feature in one of my projects, where some data values do not exist for all categories. then to reoccur later in the series. Really glad to see that it is allready reported.

Thanks @geekboy0801 @Ovilia @100pah

TobiasSvenberg avatar Mar 22 '19 07:03 TobiasSvenberg

@TobiasSvenberg I understand. But this feature is not so easy to implement. We will work on this but please understand that you may not have this feature very quickly.

Ovilia avatar Mar 26 '19 04:03 Ovilia

@Ovilia I under stand that πŸ˜„ No problem, I can work around it. This would be a great addition to a great library though. Thanks for letting me know πŸ‘

TobiasSvenberg avatar Mar 26 '19 07:03 TobiasSvenberg

Hey, yes, it will be great if this feature is implemented! Maybe, are there some workarounds on this issue for now, that don't have annoying spaces?

alex-semenyuk avatar Aug 15 '19 14:08 alex-semenyuk

Create a custom series, which you can control each bar like this one.

Ovilia avatar Aug 27 '19 03:08 Ovilia

Currently, there is no easy way to make the categories to be of different width. Further discussion required.

Ovilia avatar Sep 25 '19 10:09 Ovilia

We need more scenarios to state why this feature requested is necessary.

Ovilia avatar Oct 16 '19 04:10 Ovilia

I think there are some pretty common scenarios which exactly require this feature. Here some examples when thinking about displaying car sales in a bar chart:

  • Displaying the number of sold cars per manufacturer and year. There will be manufacturers which don't have car sales in every year since they didn't exist at that time or already went bankrupt. So you don't want that the space is preserved for them since there are some fluctuations over the years and otherwise the chart would look really scattered and not very readable.

  • Displaying the number of sold cars per manufacturer and model. Obviously, each manufacturer has a different number of models and each model is unique per manufacturer.

Please note, these are just hypothetical scenarios and the amount of data displayed in a single chart might be too big, but you can easily adjust it by only displaying the top 10 per series. I'm also aware, that in some cases stacked bars might be a valid workaround, but often they are not serving the purpose. These examples should just show that it is pretty common to have varying categories over multiple series.

In general, I think it is a highly beneficial feature to have the option to configure to don't preserve space for bars which don't have any data.

f-loris avatar Oct 23 '19 07:10 f-loris

Good afternoon. Any news 'bout this issue?

pedroviniv avatar Mar 09 '20 20:03 pedroviniv

Good afternoon. Any news 'bout this issue?

972346589 avatar Mar 16 '20 07:03 972346589

I am developing an app and I use Echarts for charts. I faced this issue aswell and it is a big burden for real scenarios, making the chart unusable when there are more than just a few columns (and even if they are few, its really ugly).

The chart becomes unusable and unreadable when enough bars get added to it.

image

The image that @geekboy0801 used a year ago is a really close scenario to what I end up facing many times.

This library is great and I'd love to see this issue sorted out.

Reghick avatar Sep 26 '20 08:09 Reghick

I also encountered this kind of problem. How did you solve it?

pgh147 avatar Dec 07 '20 01:12 pgh147

This is a real problem for me. I have very sparse data image

Das-dasein avatar Apr 05 '21 11:04 Das-dasein

image

I used a horizontal stacked chart, this is the only solution that meets my business requirements

ahmadshkour avatar Sep 12 '21 04:09 ahmadshkour

Has there been any progress or a workaround for this issue? This feature is crucial for my company's web application.

Eskimo111 avatar May 16 '23 02:05 Eskimo111

There is a reason why this "feature" is not implemented. Because there are two "pick-your-poison" options. A) - consistent xAxis with variable-width bars B) - inconsistent xAxis with constant-width bars image

Some people may find B acceptable, but I doubt other charting libraries are supporting it. Examples are welcome. UPDATE: option B has been solved, see reference below.

@ahmadshkour solution is good - stacked bars for both consistent axis and bar width. The only disadvantage is that bar comparison is difficult. But this can be remediated by adding a stack toolbar button. Then the user can quickly switch between stacked and non-stacked bars for comparison.

helgasoft avatar Oct 07 '23 22:10 helgasoft

Also meet the same problem. Still waiting news...

qhsong avatar Feb 19 '24 13:02 qhsong

@qhsong, this has been solved - see Demo Code in #19250

helgasoft avatar Feb 19 '24 19:02 helgasoft

Thanks a lot,I will try this code.

On Tue, Feb 20, 2024 at 03:04 helgasoft @.***> wrote:

@qhsong https://github.com/qhsong, this has been solved - see Demo Code in #19250 https://github.com/apache/echarts/issues/19250

β€” Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/9899#issuecomment-1953032738, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS4FC2W6373YZERMTOTMXDYUOO2XAVCNFSM4GWLLRQKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJVGMYDGMRXGM4A . You are receiving this because you were mentioned.Message ID: @.***>

qhsong avatar Feb 21 '24 14:02 qhsong