apache / echarts

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

[Feature] Align multiple Y Axis 0 line #16154

Open jack-chui opened 2 years ago

jack-chui commented 2 years ago

What problem does this feature solve?

I read the API document but I cannot see a method to align 0 line for different Y Axis Capture .

What does the proposed API look like?

Any method can help me to align different 0 line in Y axis?

mdhxolta commented 2 years ago

I would like to know this as well

ThomasKientz commented 2 years ago

@pissang Shouldn't the new option alignTicks address this ?

Daraan commented 2 years ago

alignTicks aligns the ticks that they are on top of each other but it is not value specific. That the 0 is aligned to the other 0 is not given if there are negative numbers.

A second option to manually align values to values wood be good. Or is there a point I'm missing?

In my example the 0s can't be aligned via alignTicks if the sides have not the same proportions. Imgur

Superkarl commented 2 years ago

If you set the min and max values, the 0 line will be displayed correctly. I have calculated the min and max values of all Y axes on the basis of the data and passed them in the options.

I hope that helps a little bit.

Geloosa commented 1 year ago

Hey! Any updates on this one?

API proposal

yAxis.alignValues: number - Aligns ticks with the passed value on multiple numeric y axes. Only available for axes of type 'value' or log.

Or, as this probably is only needed to align 0 values, yAxis.alignZero: boolean - Aligns ticks with the 0 value on multiple numeric y axes. Only available for axes of type 'value' or log.

snibbo commented 1 year ago

@Superkarl

Unfortunately, this does not solve my issue. My values on the first axis have amounts of millions and my second axis' values have cents. Setting a Min value leads to unseeable/unnoticeable chart elements (e.g. super small bars) for elements on my second axis.

Would be a really cool feature to align both axis on the 0-line, because the rest just looks odd to me (and my executives) :)

Pk13055 commented 12 months ago

After almost 3 years, this issue is still open. If someone from the team can address at least whether this will be addressed or not will help guide decisions as to charting library adoption. For reference, this is a highcharts implementation with 4 y axes all with different range(s)/min/max

agusdutra commented 8 months ago

Hi, any updates on this issue?

oneart-dev commented 8 months ago

Hey team, please have a look, It should be possible to do

agusdutra commented 7 months ago

I think the problem is on the alignScaleTicks function added in this PR https://github.com/apache/echarts/pull/16300

@pissang since you implemented, would you have some light on how to fix this? I've tried to get around it but I'm not familiar with the implementation of the library.

Thanks

Rookior commented 4 months ago

Any updates on this one? just like alignZero: boolean

bertrandgorge commented 2 months ago

This would definitely be useful...!