Page 1 of 1

Add 2nd axis on right with a different scale (min and max values)

Posted: Thu Sep 22, 2022 5:52 pm
by 17489583
Hi, please refer the chart below. I'm trying to create a single chart with a bar graph, points. Since the values of the bars are larger than points (i.e maximum value of the left axis is so big), they look almost 0 value. Is there any solution? I'm thinking of adding a different scale on right for points and so that it can have its own minimum and maximum. Please help if there's a better solution for this problem. If you have any further questions, I would be happy to answer. Thanks in advance.
135E5837-8BAA-4B84-B9D5-9E2793A946CF_4_5005_c.jpeg
135E5837-8BAA-4B84-B9D5-9E2793A946CF_4_5005_c.jpeg (78.08 KiB) Viewed 17601 times

Re: Add 2nd axis on right with a different scale (min and max values)

Posted: Mon Sep 26, 2022 6:30 am
by yeray
Hello,

One of the the most common solutions to this issue is what you mention: to make the right axis visible and assign a series to it.
An alternative would be to add a custom axis at the left side and assign a zone to each axis, like in the MultiScrollDemo:
javaw_2022-09-26_08-29-36.png
javaw_2022-09-26_08-29-36.png (208.21 KiB) Viewed 17568 times

Re: Add 2nd axis on right with a different scale (min and max values)

Posted: Mon Sep 26, 2022 9:28 pm
by 17489583
Thanks, Yeray. Adding a custom axis is definitely an option, however, I would like first to try 1st option (making right axis). Could you share examples if you have any? A GitHub link would work too. Thanks again!

Re: Add 2nd axis on right with a different scale (min and max values)

Posted: Tue Sep 27, 2022 6:46 am
by yeray
Hello,
17489583 wrote:
Mon Sep 26, 2022 9:28 pm
I would like first to try 1st option (making right axis).
You only need to set a series to use the right axis. Ie:

Code: Select all

chart.getSeries(1).setVerticalAxis(VerticalAxis.RIGHT);
Here another example about using custom axes:
javaw_2022-09-27_08-46-01.png
javaw_2022-09-27_08-46-01.png (208.77 KiB) Viewed 17538 times

Re: Add 2nd axis on right with a different scale (min and max values)

Posted: Tue Sep 27, 2022 3:41 pm
by 17489583
This is very helpful, Yeray. Thanks for the timely help. Appreciate it! You may close this thread now.