-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
noDataText doesn't work on CombinedChart (works fine on PieChart and BarChart) #1896
Comments
As far as I can see: if _data === nil && noDataText.characters.count > 0
{
} This is the only condition the noDataText will be rendered for any chart.. So set the combinedData to nil. |
Hi again. I tried that but .combinedData is get-only property so I set .data to nil, and checked your condition, it is always true and still doesn't work. Below is the code for creating combined graph, maybe you can get an idea what might be a problem. Tnx
|
I tried with ChartsDemo: - (void)setChartData
{
CombinedChartData *data = [[CombinedChartData alloc] init];
data.lineData = [self generateLineData];
data.barData = [self generateBarData];
data.bubbleData = [self generateBubbleData];
data.scatterData = [self generateScatterData];
data.candleData = [self generateCandleData];
_chartView.xAxis.axisMaximum = data.xMax + 0.25;
_chartView.data = nil;
} It works as expected, showing 'No chart data available' in combined chart. |
@liuxuan30 it works with default text (No chart data available.), but I can't set custom string as I can do it with BarChart and PieChart. Regarding what is combinedData, you said that I need to set it to nil, but since combinedData is get-only property I can only set .data property to nil, and in the code above I'm just checking if conditions are met (which they are, both combinedData and data are nil and noDataText is set). I also added breakpoint to your code that check if conditions are met (inside ChartViewBase). Can you please check if your example works when you set custom string to noDataText. |
Ok, solved, it was my mistake, setting noDataText in viewDidAppear was the problem + combinedChartView.notifyDataSetChanged() needs to be called, while on BarChart and PieChart that's not needed (at least in my case). |
Is there any difference how to set noDataText on CombinedChart? It works without any problem on PieChart and BarChart
The text was updated successfully, but these errors were encountered: