Page 1 of 1

Solid gauge labels

Posted: Wed Dec 05, 2018 10:00 am
by davidchuco
Hi,

i've a little problem... i need put the serie's value next to the finish line.

Sample: https://jsfiddle.net/xwj97562/3/

Image: https://ibb.co/YXjBWdW

Any suggestion?

Thanks!

Re: Solid gauge labels

Posted: Wed Dec 05, 2018 12:00 pm
by bastss
Hello davidchuco,

I've generated this values at the ends of each line as yAxis.labels API: https://api.highcharts.com/highcharts/yAxis.labels. It was easy to set first and second label, but the position of the last one has to be changed by use events.render function API: https://api.highcharts.com/highcharts/c ... nts.render. Check this example: https://jsfiddle.net/Bastss/0g3qzmtb/

Kind regards!

Re: Solid gauge labels

Posted: Wed Dec 05, 2018 4:41 pm
by davidchuco
Thanks!

I think it's a possible solution, but if i have 6 lines (for example), they don't alignment all labels.

Sample: https://jsfiddle.net/9cpmyf42/

I try a lot of solutions... but nothing :(

any suggestion?

Re: Solid gauge labels

Posted: Thu Dec 06, 2018 10:28 am
by bastss
davidchuco,

Could you explain what you want to achieve in your example?

Re: Solid gauge labels

Posted: Tue Dec 11, 2018 10:11 am
by davidchuco
Hi!

Yes, of course. I try to draw something similar like this: https://ibb.co/YXjBWdW

Imagine you have 7 series and a gauge solid with half radio. ( Like an image)

I want to draw percentage value where the line is finished. The problem on the first solution is the value position. You can try with the following values: 20,40,70,90,100. The value position is not alignment.

Thank you so much!

Re: Solid gauge labels

Posted: Wed Dec 12, 2018 2:16 pm
by rafalS
Hi, davidchuco!

Here you have some code that will calculate labels' positions, render them properly always in the place where a point ends and rotate them. It will work properly until you have every single point in a separate series.

Let me know if you have any additional questions.

jsFiddle: https://jsfiddle.net/BlackLabel/ho65fwm9/

Best regards!

Re: Solid gauge labels

Posted: Fri Dec 14, 2018 8:05 am
by davidchuco
wow... it's really amazing!

I tried it 3 days ago, but never had good results.

Thank you so much! :D

Re: Solid gauge labels

Posted: Fri Dec 14, 2018 10:57 am
by rafalS
You're welcome! ;)