Pie Chart for Dynamic values in ios - pie-chart

I am beginner in iOS development .I am developing an application and I want create pie chart using dynamic data from JSON.
Data will looks like:
{
"name": "Sales",
"total_earning": "904006",
"per": 40.41
},
{
"name": "Service",
"total_earning": "596845",
"per": 26.68
}
I want display "per" in pie chart and it's dynamic values.
Can you tell me which is the best way?
This pie chart for Department wise Earning Report in Android I want to make

You can use dlpiechart class of dilipajm in GitHub, then, modify property & var for your purpose. Hope its useful.

Related

How can i add a graphical represntation of the data in spline chart form

enter image description here
I want to add this to my Flutter app, how can I achieve this the data model that I am collecting is:
amount: 5.123
category: Health
date: 08-Feb-2023 23:45 PM
This is the form of data which I am storing in the firebase
you can use syncfusion_flutter_charts package which give different types of charts for example
you can also use fl_chart package which also gives a variety of charts one of them is
read more about their implementation on pub.dev

Retaining caption and subCaption with no data in FusionCharts

We use many charts, and some of them simply lack data, especially when filtering for dates. In these cases, the "No data to display." message appears. That's all well and good, but the problem is that the captions and subcaptions (which we use as titles and subtitles) of the charts disappear, thereby making it difficult to identify which of the half dozen charts lack data.
example:
{
"chart": {
"caption": "My Caption",
"subcaption": "My Subcaption",
"plottooltext": "Document: $label<br />Total: $datavalue",
"theme": "fusion",
},
"data": []
}
Is there a setting we can use to still display the caption and subcatption when there is no data?
I'd suggest looking at replacing the caption and subcaption with your own HTML. The captions aren't required on the charts and can be completely removed. Just make an HTML header and embed your chart below it and make sure it has no captions.

Get all series from a chart with Google Apps Script

I have a sheet with 30 charts and I'm trying to iterate over all of them updating the colors of the background and the series.
Even though I could do it blindly, I'd rather be able to look at all the series in a chart first so that I could add extra logic based on the number of series, if it is already using one of my custom colors, title, etc. The problem is that I couldn't find a way to get the series from a chart.
Given that I can modify the series with setOptions I thought something like sheet.getCharts()[0].getOptions().get('series') would work, but it returns Access to class "(class)" is prohibited. when I try to log it.
Any advice on how to get an object where I can read information about the series in a chart?
its like hashmap (key/value) when you set option put key and value and when you get it try to use json to get the oject value too
function myfunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var len = sheet.getCharts().length;
for(var i=0;i<len;i++){
var bg=sheet.getCharts()[i].getOptions().get('backgroundColor.fill');
var s=sheet.getCharts()[i].getOptions().get('series.0.color');
}
}

Sencha touch charts 2: Dynamically create chart and load series from the store?

I want to create a scatter chart dynamically and load the series by fetching the data from the store. Is there any method to do that? I did the following:
var myChart = Ext.create('Ext.chart.Chart',{
id:'myChart',
renderTo:'myPanel',
axes:[], // blank because i need to add axes from store
series:[] // blank because i need to add series from store
:
:
});
for(conditions){
myChart.config.axes[0].fields.push(record[cnt].data.fieldName);
var series = {
type:'scatter',
axis:['right', 'bottom'],
xField:'myXfield',
yField:record[cnt].data.yfieldVal
}
myChart.config.series.push(series);
}//for loop ends
myChart.redraw();
Iam not able to see the chart with the plots that are dynamically added.
Any help will be appriciated!
Thanks!
I realized how to address the issue. I declared Global variables for the store name and other related fields. I created the get and set methods. These are defined in app.js file. I was able to set the values dynamically to these global variables using set methods and use the assigned values using the get methods. I hope someone will be able to use this technique if required.

Google Chart Tools - How to create stacked bar chart [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Can someone help me create a simple vertical bar chart using google charts?
Im using new Google Chart Tools, and I want to create stacked bar chart format.
The Google Developers site gives some details on the bar chart format: https://developers.google.com/chart/interactive/docs/gallery/barchart
To make a normal bar chart stacked, you need to user the isStacked: true option. You can copy and paste the following code into the Chart Tools playground to see a working example:
http://code.google.com/apis/ajax/playground/?type=visualization
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria', 'Bulgaria', 'Denmark', 'Greece'],
['2003', 1336060, 400361, 1001582, 997974],
['2004', 1538156, 366849, 1119450, 941795],
['2005', 1576579, 440514, 993360, 930593],
['2006', 1600652, 434552, 1004163, 897127],
['2007', 1968113, 393032, 979198, 1080887],
['2008', 1901067, 517206, 916965, 1056036]
]);
// Create and draw the visualization.
new google.visualization.BarChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"},
hAxis: {title: "Cups"},
isStacked: true}
);
}
You might also be interested in a Stacked Area Chart, depending on what data you are trying to display.
There is also a question which gives an example of a stacked bar chart using the Chart Tools Image API: Bar chart in Javascript: stacked bars + grouped bars
Note that the Image Charts portion of Google Chart Tools was officially deprecated on the 20th April, 2012. Image charts will still work for a while as per Google's deprecation policy, but I recommend you concentrate on the interactive HTML5+SVG implementation described above.