Comments (7)
@kevinlcfei Are you still using version 2.2.4.1 or did you change to 2.2.5?
There were some property bindings done wrong in 2.2.4. I redid everything for 2.2.5.
Can you provide a log? If you can't catch the exception, it will be shown in the device logs.
from ioscharts.xamarin.
Yes. updated via XPM to the latest version.
Using 2.2.5.1ver.
Tried catch exception in the sample code provided in XS - it failed to jump in.
Attached file for the log file for your reference.
crash log.txt
from ioscharts.xamarin.
@kevinlcfei What's the value for pieChartModel.dataSetLegend.Length?
PieChartView only supports one DataSet.
I've been running some tests today and it crashes only when it uses more than one PieChartDataSet in PieChartData.
Tell me if it is the same for your. If it isn't please provide a complete sample so I can give it a try too.
from ioscharts.xamarin.
@Flash3001 The value for pieChartModel.dataSetLegend.Length is flexible. Using live data for this project.
Provided the screenshots, is it what you mentioned more than one PieChartDataSet?
Could not provide you the code due to some reason here. Would you mind show me how is your tests?
from ioscharts.xamarin.
The problem is that the PieChart is one-dimensional while a BarChart is bi-dimensional.
var itens = Enumerable.Range(1, 5);
var dataSet = new PieChartDataSet(itens.Select(c => new BarChartDataEntry(c * 20, c)).ToArray(), "Unique");
dataSet.SliceSpace = 2;
(dataSet as ChartDataSet).Colors = ChartColorTemplates.Joyful; // Need to fix this property override in the API Definition
NSObject[] labels = itens.Select(c => new NSString(c.ToString())).ToArray();
var minhaView = new iOSCharts.PieChartView(View.Frame);
minhaView.Data = new iOSCharts.PieChartData(labels, new PieChartDataSet[] { dataSet });
View.AddSubview(minhaView);
minhaView.SpinWithDuration(2, 0, 360);
from ioscharts.xamarin.
@Flash3001 thanks for the sample code. managed to solved the crash issue.
Having UI issue here. Need your understanding of the pie chart view.
pieChartView.DrawSliceTextEnabled = false;
**pieChartView.HoleColor = chartColors[0];** HERE
pieChartView.TransparentCircleColor = UIColor.Clear;
pieChartView.BackgroundColor = UIColor.Clear;
pieChartView.HoleRadiusPercent = 25f;
pieChartView.MultipleTouchEnabled = false;
pieChartView.NoDataTextDescription = "";
pieChartView.DescriptionText = ""; // Disable description - chartView.SetDescription (String.IsNullOrEmpty (dataModel.name) ? "" : dataModel.name);
pieChartView.NoDataText = ""; // Text displayed when no data is given ("You need to provide data for the chart.");
ChartLegend legend = pieChartView.Legend;
legend.Position = ChartLegendPosition.BelowChartCenter;
legend.Form = ChartLegendForm.Square;
legend.FormSize = 9f;
legend.XEntrySpace = 15f;
legend.TextColor = chartTextColor;
BarChartDataEntry[] pieEntry = new BarChartDataEntry[pieChartModel.yAxis.Count];
for (int j = 0; j < pieChartModel.yAxis.Count; j++)
{
pieEntry[j] = new BarChartDataEntry((float) pieChartModel.yAxis[j][0], j);
}
NSObject[] xData = new NSObject[pieChartModel.dataSetLegend.Length];
for (int i = 0; i < xData.Length; i++)
{
xData[i] = NSObject.FromObject(pieChartModel.dataSetLegend[i]);
}
var yDataSets = new PieChartDataSet(pieEntry, null);
yDataSets.SliceSpace = 3;
yDataSets.SelectionShift = 5;
yDataSets.SetColors(chartColors, 1.0f);
var data = new PieChartData(xData, new PieChartDataSet[] { yDataSets });
data.SetValueFormatter(new NSNumberFormatter());
data.SetValueTextColor(UIColor.Gray);
data.HighlightEnabled = false; // Disable highlight selection
if (pieChartModel.xAxis.Count == 0 && pieChartModel.yAxis.Count == 0
|| pieChartModel.emptyTableStatus)
{
pieChartView.MultipleTouchEnabled = false;
pieChartView.NoDataText = "No Results Were Found."; // Text displayed when no data is given ("You need to provide data for the chart.");
pieChartView.HoleRadiusPercent = 0f;
if (!pieChartView.IsEmpty)
pieChartView.Clear();
}
else
{
pieChartView.MultipleTouchEnabled = true;
pieChartView.Data = data;
}
if (animateChart)
pieChartView.SpinWithDuration(2, 0, 360);
Hightlighted and Italics text copy screen (Look for "HERE" keyword)
Commented the pieChartView.HoleColor result copy screen.
Q: The pie chart did not show the expected result. Does the Hole are causing the issue or dataset(checked its consists of data.) is caused it?
from ioscharts.xamarin.
@kevinlcfei I believe I can't help this time. I'm not that expert but you can take a look at this code and see how it works:
If it doesn't help you might create an issue on the original library repo:
https://github.com/danielgindi/Charts/issues
I'm sorry for taking so long to give you an answer and not the best one.
from ioscharts.xamarin.
Related Issues (20)
- InvalidSwiftSupport - Again HOT 5
- Crash with custom ChartXAxisRenderer HOT 2
- DYLD, Symbol not found HOT 1
- XAxis value formatter not working HOT 1
- Was Successfully able to upload the ipa in the Application Loader But got an Email from Apple iTunes Connect stating there are one or more issues HOT 1
- CandleStick Chart is not showing up within a CombinedChart on the latest release of 3.2.0 HOT 4
- Works fine on Device, but not in Simulator HOT 9
- upload to appstore issue HOT 3
- Library not loaded: @rpath/libswiftCore.dylib HOT 13
- First point not showing on line graph HOT 1
- How to Control the Y axis Value difference it is always showing 100 difference HOT 1
- iOSCharts crash on iOS 13 only, update iOSCharts.Xamarin to support iOS 13 HOT 1
- Support for xCode 11 HOT 1
- Invalid Swift Support - The expected dylibs are missing from the app's Framework location, such as /Payload/CreditInfo.iOS.app/Frameworks HOT 2
- Missing library - libswiftCore.dylib error
- Custom renderers are not working HOT 2
- [Query]Are you planning to update binding to 4.0.1 ? HOT 1
- Round corners
- Not compatible with the latest .Net for iOS
- Problem with net7. Not compiling. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ioscharts.xamarin.