highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

How to check if all legend items are selected/unselected in highcharts #358

Closed ruchiKumar14 closed 3 years ago

KacperMadej commented 3 years ago

Hi @ruchiKumar14

The "No data to display" text should show when all series are hidden when the no-data-to-display module is loaded. Demo: https://jsfiddle.net/BlackLabel/bLgvktnx/1/ Toggle the series visibility by the legend item click and see the text.

If this doesn't help please share a minimal configuration required to recreate the problem.

ruchiKumar14 commented 3 years ago

@KacperMadej , i have checked the demo that you shared , i want the same like how it is managed in the demo, when clicked on legends, then it displays the "No data display" when all legends are selected, but the demo you have shared is in Javascript, and i want to do the same in swift. So can you share me the piece of code that is in swift. As you can see in the video, i want to display "No data to display" when both the series i.e, "Benchmark" and "Actual" is clicked, but currently it is not happening.

https://user-images.githubusercontent.com/70438308/107063128-03531f80-6800-11eb-8e35-c3a39fd9e732.mov

ihnatmoisieiev commented 3 years ago

Hello @ruchiKumar14,

did you add no-data-to-display plugin?

chartView.plugins = ["no-data-to-display"]
ruchiKumar14 commented 3 years ago

Oh my god, Thank you so much @ihnatmoisieiev, it worked. I was trying it from so many days, and you gave me a one line code solution. Thanks a lot. The font is little bit small, can you help me with it. How can i increase the font size of "No data to display" text. Simulator Screen Shot - iPhone 11 - 2021-02-10 at 22 40 13

ihnatmoisieiev commented 3 years ago

@ruchiKumar14 sure, just set up noData.style object, eg.

let noData = HINoData()
noData.style = HICSSObject()
noData.style.fontSize = "25px"
options.noData = noData
ihnatmoisieiev commented 3 years ago

Closing due to inactivity.