mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Custom column bar with negative values

Hi tyahav,

It seems that the labels are cut where the container ends:
https://jsfiddle.net/BlackLabel/htan0zeo/

As a solution please set spacingBottom:
https://jsfiddle.net/BlackLabel/1kstreo4/

Feel free to ask any further questions.
Regards!
Mateusz Bernacik
Highcharts Developer
tyahav
Posts: 15
Joined: Thu Jul 01, 2021 7:37 am

Re: Custom column bar with negative values

mateusz.b wrote: Thu May 26, 2022 2:51 pm Hi tyahav,

Could you provide me with the demo where values are being cut? Thanks in advance.

Regards!
Please, I am waiting for your help.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Custom column bar with negative values

Hi tyahav,

The answer is ready and I'm waiting for your feedback. Perhaps you have missed it because it is on second page on the thread now. Let me know if you've seen it:
mateusz.b wrote: Mon May 30, 2022 8:29 am Hi tyahav,

It seems that the labels are cut where the container ends:
https://jsfiddle.net/BlackLabel/htan0zeo/

As a solution please set spacingBottom:
https://jsfiddle.net/BlackLabel/1kstreo4/

Feel free to ask any further questions.
Regards!
Regards!
Mateusz Bernacik
Highcharts Developer
tyahav
Posts: 15
Joined: Thu Jul 01, 2021 7:37 am

Re: Custom column bar with negative values

mateusz.b wrote: Tue May 31, 2022 12:25 pm Hi tyahav,

The answer is ready and I'm waiting for your feedback. Perhaps you have missed it because it is on second page on the thread now. Let me know if you've seen it:
mateusz.b wrote: Mon May 30, 2022 8:29 am Hi tyahav,

It seems that the labels are cut where the container ends:
https://jsfiddle.net/BlackLabel/htan0zeo/

As a solution please set spacingBottom:
https://jsfiddle.net/BlackLabel/1kstreo4/

Feel free to ask any further questions.
Regards!
Regards!
Working! thanks!
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Custom column bar with negative values

You're welcome! In case of any further questions, feel free to contact us again.
Mateusz Bernacik
Highcharts Developer
tyahav
Posts: 15
Joined: Thu Jul 01, 2021 7:37 am

Re: Custom column bar with negative values

tyahav wrote: Wed May 25, 2022 9:44 am
tyahav wrote: Wed May 25, 2022 9:30 am
mateusz.b wrote: Mon May 23, 2022 6:16 am Hi tyahav,

Please add another condition like in my previous answer to see if values are negative only, and then adjust labels' position:
Demo: https://jsfiddle.net/BlackLabel/usj9vhq1/

Let me know if you have any further questions!
Regards!
Great, now it works. Thank you so much!!
How can I add space between positive and negative bars?
Like that:

I was trying to do it and it works - thank you.
I have another issue that I need your help with, I have a 4 tabs - the first tab displays the chart above and the rest of the 3 tabs display a different chart, when changing tabs the charts aren't changing/updated - only one type of chart is displayed (if I am refreshing the page, it loads the selected tab chart for the rest of the tabs).
How can we set initialization when changing tabs? how I can load the chart for each tab everytime it loads?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Custom column bar with negative values

Hi tyahav,

Frankly speaking this questions goes slightly beyond the scope of our support, because the answer depends more on the technologies / architecture that you use in your app.

Here are few approaches that you might want to try:
- Destroy existing chart each time you change the tab and create completely new one:
Demo: https://jsfiddle.net/BlackLabel/s9nL2hmy/
API reference: https://api.highcharts.com/class-refere ... rt#destroy

- Hide and show charts using css:
Demo: https://jsfiddle.net/BlackLabel/tf6nzj32/

- Use single chart and update its properties each time you change the tab:
API reference: https://api.highcharts.com/class-refere ... art#update

To make it work you will most likely have to use some sort of event listener that would react to tab or state change, but as I said, it depends on your app architecture.

Let me know if you have any further questions.
Regards!

-
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”